public class MetadataReader extends java.lang.Object implements ChunkReader
Modifier and Type | Field and Description |
---|---|
private static GUID[] |
APPLYING
The GUID this reader applies to
|
Constructor and Description |
---|
MetadataReader() |
Modifier and Type | Method and Description |
---|---|
boolean |
canFail()
Tells whether the reader can fail to return a valid chunk.
The current Use would be a modified version of StreamChunkReader ,
which is configured to only manage audio streams. |
GUID[] |
getApplyingIds()
Returns the GUIDs identifying the types of chunk, this reader will parse.
|
Chunk |
read(GUID guid,
java.io.InputStream stream,
long streamPosition)
Parses the chunk.
|
private boolean |
readBoolean(java.io.InputStream stream,
int bytes)
Reads the given amount of bytes and checks the last byte, if its equal to
one or zero (true / false).
All other bytes must be zero. |
private static final GUID[] APPLYING
public boolean canFail()
StreamChunkReader
,
which is configured to only manage audio streams. However, the primary
GUID for audio and video streams is the same. So if a stream shows itself
to be a video stream, the reader would return null
.canFail
in interface ChunkReader
true
, if further analysis of the chunk can show,
that the reader is not applicable, despite the header GUID
identification told it can handle
the chunk.public GUID[] getApplyingIds()
getApplyingIds
in interface ChunkReader
public Chunk read(GUID guid, java.io.InputStream stream, long streamPosition) throws java.io.IOException
read
in interface ChunkReader
guid
- the GUID of the chunks header, which is about to be read.stream
- source to read chunk from.GUID
is expected at the currents stream position.
The length of the chunk is about to follow.streamPosition
- the position in stream, the chunk starts.Chunk
).java.io.IOException
- On I/O Errors.private boolean readBoolean(java.io.InputStream stream, int bytes) throws java.io.IOException
stream
- stream to read from.bytes
- amount of bytestrue
or false
.java.io.IOException
- on I/O ErrorsCopyright © 2005-2013 java.net. All Rights Reserved.