public interface RIFFChunk extends InterchangeObject
Specifies a chunk of resource interchange file format (RIFF) data, identified by a 4-byte tag and variable size field.
| Modifier and Type | Method and Description |
|---|---|
RIFFChunk |
clone()
Create a cloned copy of this RIFF chunk.
|
Stream |
getChunkData()
Returns the complete data of this RIFF chunk.
|
int |
getChunkID()
Returns the chunk id of this RIFF chunk, which is a 4-byte tag that identifies this tag.
|
int |
getLength()
Returns the total size of this RIFF chunk measured in bytes.
|
long |
getPosition()
Returns the current position for reading or writing the RIFF chunk data.
|
ByteBuffer |
read(int numberOfBytes)
Read the requested number of bytes from the RIFF chunk at the current position.
|
void |
setChunkData(Stream chunkData)
Sets the complete data of this RIFF chunk and initializes the position to zero.
|
void |
setChunkID(int chunkId)
Sets the chunk id of this RIFF chunk, which is a 4-byte tag that identifies this tag.
|
void |
setPosition(long offset)
Sets the position for reading or writing this RIFF chunk data.
|
void |
write(ByteBuffer bytes)
Writes the given bytes to this RIFF chunk data at the current position.
|
addApplicationPlugin, clearApplicationPlugins, containsApplicationPlugin, containsApplicationPlugin, countApplicationPlugins, deepEquals, disableGenerationTracking, enableGenerationTracking, equals, getApplicationPlugins, getGeneration, getLinkedGenerationID, getObjectClass, isGenerationTracked, removeApplicationPlugin, removeApplicationPlugin, setLinkedGenerationID, setObjectClass, toStringgetPersistentID, setPersistentIndexvoid setChunkID(@UInt32 int chunkId)
Sets the chunk id of this RIFF chunk, which is a 4-byte tag that identifies this tag.
Note that in the representation of this tag, care needs to be taken to ensure that the sign bit is not confused with an 8-bit character code. Negative values are accepted by this method.
chunkId - Chunk identifier for this RIFF chunk.@UInt32 int getChunkID()
Returns the chunk id of this RIFF chunk, which is a 4-byte tag that identifies this tag.
Note that in the representation of this tag, care needs to be taken to ensure that the sign bit is not confused with an 8-bit character code. Negative values are accepted by this method.
@DataBuffer ByteBuffer read(@UInt32 int numberOfBytes) throws IllegalArgumentException, EndOfDataException, IOException
Read the requested number of bytes from the RIFF chunk at the current position. The position is advanced by the number of bytes read.
numberOfBytes - Number of bytes to read from the RIFF chunk.IllegalArgumentException - Cannot read a negative number of bytes.EndOfDataException - The number of bytes requested are not available in the
RIFF chunk relative to the current position.IOException - Error occurred when trying to read from the underlying
stream.getPosition()void write(@DataBuffer ByteBuffer bytes) throws NullPointerException, EndOfDataException, IOException
Writes the given bytes to this RIFF chunk data at the current position. The position is advanced by the number of bytes written. Any data beyond the new position is lost by truncating the buffer.
bytes - Bytes to write to the RIFF chunk data.NullPointerException - The given array of bytes is null.EndOfDataException - The size of the RIFF chunk is less than the number of bytes
to write relative to the current position.IOException - Error occurred when trying to write to the underlying stream.getPosition()void setPosition(@PositionType long offset) throws PositionOutOfRangeException, IOException
Sets the position for reading or writing this RIFF chunk data.
offset - Position offset to set for reading or writing RIFF chunk data.PositionOutOfRangeException - The given offset is outside the acceptable
range for this RIFF chunk data, which is between 0 and the length of the data.IOException - Error occurred when trying to set the position for the
underlying stream.getLength()@PositionType long getPosition() throws IOException
Returns the current position for reading or writing the RIFF chunk data.
IOException - Error occurred when trying to set the position for the
underlying stream.@UInt32 int getLength()
Returns the total size of this RIFF chunk measured in bytes. The length is
initially 0 until setChunkData(Stream) has been called.
@DataBuffer Stream getChunkData()
Returns the complete data of this RIFF chunk.
void setChunkData(Stream chunkData) throws NullPointerException
Sets the complete data of this RIFF chunk and initializes the position to zero. The length property of this RIFF chunk will be set to the length of the given chunk data.
chunkData - Actual data for this RIFF chunk.NullPointerException - The chunk data argument is null.RIFFChunk clone()
Create a cloned copy of this RIFF chunk.
clone in interface InterchangeObjectclone in interface MediaEntity(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.