public class Chunk extends java.lang.Object implements java.lang.Comparable<Chunk>
Constructor and Description |
---|
Chunk(ChunkType chunkType,
long length,
byte[] data,
long crc) |
Modifier and Type | Method and Description |
---|---|
static long |
calculateCRC(int chunkValue,
byte[] data) |
static long |
calculateCRC(int chunkValue,
byte[] data,
int offset,
int length) |
int |
compareTo(Chunk that)
Compare different chunks according to their Attribute ranking.
|
boolean |
equals(java.lang.Object that) |
ChunkType |
getChunkType() |
long |
getCRC() |
byte[] |
getData() |
long |
getLength() |
int |
hashCode() |
boolean |
isValidCRC() |
java.lang.String |
toString() |
void |
write(java.io.OutputStream os) |
public Chunk(ChunkType chunkType, long length, byte[] data, long crc)
public int compareTo(Chunk that)
compareTo
in interface java.lang.Comparable<Chunk>
public ChunkType getChunkType()
public long getLength()
public byte[] getData()
public long getCRC()
public boolean isValidCRC()
public void write(java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object that)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static long calculateCRC(int chunkValue, byte[] data)
public static long calculateCRC(int chunkValue, byte[] data, int offset, int length)