|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jaudiotagger.audio.asf.io.AsfHeaderReader
public class AsfHeaderReader
This class reads an ASF header out of an input stream an creates an
AsfHeader object if successful.
For now only ASF ver 1.0 is supported, because ver 2.0 seems not to be used
anywhere.
ASF headers contains other chunks. As of this other readers of current
package are called from within.
| Field Summary | |
|---|---|
static int |
READ_LIMIT
Within this range, a ChunkReader should be aware if it fails. |
| Constructor Summary | |
|---|---|
AsfHeaderReader(java.util.List<java.lang.Class<? extends ChunkReader>> toRegister,
boolean readChunkOnce)
Creates an instance of this reader. |
|
| Method Summary | |
|---|---|
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 |
getApplyingId()
Returns the GUID identifying the type of chunk, this reader will parse. |
ChunkType |
read(GUID guid,
java.io.InputStream stream,
long chunkStart)
This Method implements the reading of a chunk container. |
static AsfHeader |
readHeader(java.io.File file)
This method extracts the full ASF-Header from the given file. If no header could be extracted null is returned. |
static AsfHeader |
readHeader(java.io.RandomAccessFile in)
This method tries to extract a full ASF-header out of the given stream. |
static AsfHeader |
readInfoHeader(java.io.RandomAccessFile in)
This method tries to extract an ASF-header out of the given stream, which only contains information about the audio stream. If no header could be extracted null is returned. |
static AsfHeader |
readTagHeader(java.io.RandomAccessFile in)
This method tries to extract an ASF-header out of the given stream, which only contains metadata. If no header could be extracted null is returned. |
void |
setExtendedHeaderReader(AsfExtHeaderReader extReader)
Sets the AsfExtHeaderReader, which is to be used, when an header extension object
is found. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int READ_LIMIT
ChunkReader should be aware if it fails.
| Constructor Detail |
|---|
public AsfHeaderReader(java.util.List<java.lang.Class<? extends ChunkReader>> toRegister,
boolean readChunkOnce)
toRegister - The chunk readers to utilize.readChunkOnce - if true, each chunk type (identified by chunk
GUID) will handled only once, if a reader is available, other
chunks will be discarded.| Method Detail |
|---|
public static AsfHeader readHeader(java.io.File file)
throws java.io.IOException
null is returned.
file - the ASF file to read.null if no supported ASF
header was found.
java.io.IOException - on I/O Errors.
public static AsfHeader readHeader(java.io.RandomAccessFile in)
throws java.io.IOException
null is returned.
in - File which contains the ASF header.
null if no supported Asf
header was found.
java.io.IOException - Read errors
public static AsfHeader readInfoHeader(java.io.RandomAccessFile in)
throws java.io.IOException
null is returned.
in - File which contains the ASF header.
null if no supported Asf
header was found.
java.io.IOException - Read errors
public static AsfHeader readTagHeader(java.io.RandomAccessFile in)
throws java.io.IOException
null is returned.
in - File which contains the ASF header.
null if no supported Asf
header was found.
java.io.IOException - Read errorspublic GUID getApplyingId()
public void setExtendedHeaderReader(AsfExtHeaderReader extReader)
AsfExtHeaderReader, which is to be used, when an header extension object
is found.
extReader - header extension object reader.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 ChunkReadertrue, 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 ChunkType read(GUID guid,
java.io.InputStream stream,
long chunkStart)
throws java.io.IOException,
java.lang.IllegalArgumentException
read in interface ChunkReaderguid - GUID of the currently read container.stream - Stream which contains the chunk container.chunkStart - The start of the chunk container from stream start.0 here.
null if no valid data found, else a Wrapper
containing all supported data.
java.io.IOException - Read errors.
java.lang.IllegalArgumentException - If one used ChunkReader could
fail and the stream source
doesn't support mark/reset.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||