-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChunk.java
41 lines (35 loc) · 881 Bytes
/
Chunk.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* A chunk of data file
*
* Contains an offset, bytes of data, size, and a stamp
* which is equal to the end of the range if it is the last chunk in the range
*/
class Chunk {
private byte[] data;
private long offset;
private int size_in_bytes;
private Range range;
private boolean stamp;
Chunk(byte[] data, long offset, int size_in_bytes, Range range, boolean stamp) {
this.data = data != null ? data.clone() : null;
this.offset = offset;
this.size_in_bytes = size_in_bytes;
this.range = range;
this.stamp = stamp;
}
byte[] getData() {
return data;
}
long getOffset() {
return offset;
}
int getSize_in_bytes() {
return size_in_bytes;
}
boolean getStamp() {
return stamp;
}
Range getRange() {
return this.range;
}
}