Modifier and Type | Field and Description |
---|---|
static int |
CHUNK_HEADER_SIZE |
Constructor and Description |
---|
ChunkHeader(ByteOrder byteOrder) |
Modifier and Type | Method and Description |
---|---|
String |
getID()
Returns the chunk type, which is a 4-character code.
|
long |
getSize()
Returns the chunk size (excluding the first 8 bytes).
|
long |
getStartLocationInFile()
The start of this chunk(header) in the file
|
boolean |
readHeader(FileChannel fc)
Reads the header of a chunk.
|
boolean |
readHeader(RandomAccessFile raf)
Reads the header of a chunk.
|
void |
setID(String id)
Sets the chunk type, which is a 4-character code, directly.
|
void |
setSize(long size)
Set chunk size.
|
String |
toString() |
ByteBuffer |
writeHeader()
Writes this chunk header to a
ByteBuffer . |
public static final int CHUNK_HEADER_SIZE
public ChunkHeader(ByteOrder byteOrder)
public boolean readHeader(FileChannel fc) throws IOException
true
, if we were able to read a chunk header and believe we found a valid chunk id.IOException
public boolean readHeader(RandomAccessFile raf) throws IOException
true
, if we were able to read a chunk header and believe we found a valid chunk id.IOException
public ByteBuffer writeHeader()
ByteBuffer
.public void setID(String id)
id
- 4-char idpublic String getID()
public long getSize()
setSize(long)
public void setSize(long size)
size
- chunk size without headergetSize()
public long getStartLocationInFile()
Copyright © 2005–2020 jthink.net. All rights reserved.