|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
de.jarnbjo.ogg
Class FileStream
java.lang.Objectde.jarnbjo.ogg.FileStream
- All Implemented Interfaces:
- PhysicalOggStream
public class FileStream
- extends Object
- implements PhysicalOggStream
- extends Object
Implementation of the PhysicalOggStream interface for accessing
normal disk files.
| Constructor Summary | |
|---|---|
FileStream(RandomAccessFile source)
Creates access to the specified file through the PhysicalOggStream interface. |
|
| Method Summary | |
|---|---|
void |
close()
Closes this stream. |
Collection |
getLogicalStreams()
Returns a collection of objects implementing LogicalOggStream
for accessing the separate logical streams within this physical Ogg stream. |
OggPage |
getOggPage(int index)
Return the Ogg page with the absolute index index,
independent from the logical structure of this stream or if the
index parameter is -1, the next Ogg page is returned. |
boolean |
isOpen()
Checks if this stream is open for reading. |
boolean |
isSeekable()
|
void |
setTime(long granulePosition)
Sets this stream's (and its logical stream's) position to the granule position. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
FileStream
public FileStream(RandomAccessFile source) throws OggFormatException, IOException
- Creates access to the specified file through the
PhysicalOggStreaminterface. The specified source file must have been opened for reading.- Parameters:
source- the file to read from- Throws:
OggFormatException- if the stream format is incorrectIOException- if some other IO error occurs when reading the file
| Method Detail |
|---|
getLogicalStreams
public Collection getLogicalStreams()
- Description copied from interface:
PhysicalOggStream - Returns a collection of objects implementing
LogicalOggStreamfor accessing the separate logical streams within this physical Ogg stream.- Specified by:
getLogicalStreamsin interfacePhysicalOggStream
- Returns:
- a collection of objects implementing
LogicalOggStreamwhich are representing the logical streams contained within this physical stream - See Also:
LogicalOggStream
isOpen
public boolean isOpen()
- Description copied from interface:
PhysicalOggStream - Checks if this stream is open for reading.
- Specified by:
isOpenin interfacePhysicalOggStream
- Returns:
trueif this stream is open for reading,falseotherwise
close
public void close() throws IOException
- Description copied from interface:
PhysicalOggStream - Closes this stream. After invoking this method, no further access
to the streams data is possible.
- Specified by:
closein interfacePhysicalOggStream
- Throws:
IOException
getOggPage
public OggPage getOggPage(int index) throws IOException
- Description copied from interface:
PhysicalOggStream - Return the Ogg page with the absolute index
index, independent from the logical structure of this stream or if the index parameter is -1, the next Ogg page is returned. This method should only be used by implementations ofLogicalOggStreamto access the raw pages.- Specified by:
getOggPagein interfacePhysicalOggStream
- Parameters:
index- the absolute index starting from 0 at the beginning of the file or stream or -1 to get the next page in a non-seekable stream- Returns:
- the Ogg page with the physical absolute index
index - Throws:
OggFormatException- if the ogg stream is corruptedIOException- if some other IO error occurs
setTime
public void setTime(long granulePosition) throws IOException
- Description copied from interface:
PhysicalOggStream - Sets this stream's (and its logical stream's) position to the granule
position. The next packet read from any logical stream will be the
first packet beginning on the first page with a granule position higher
than the argument.
At the moment, this method only works correctly for Ogg files with a single logical Vorbis stream, and due to the different interpretations of the granule position, depending on mixed content, this method will never be able to work for mixed streams. Chained and interleaved streams are also not yet supported. Actually, this method is only a hack to support seeking from JMF, but may of course be abused otherwise too :)- Specified by:
setTimein interfacePhysicalOggStream
- Throws:
OggFormatException- if the ogg stream is corruptedIOException- if some other IO error occurs
isSeekable
public boolean isSeekable()
- Specified by:
isSeekablein interfacePhysicalOggStream
- Returns:
- always
true
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright © 2007-2011 shredzone.org. All Rights Reserved.
de.jarnbjo.ogg.FileStream