|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.InputStream
hu.netmind.ogg.OggInputStream
public class OggInputStream
This is the starting point for decoding an ogg stream. From an instance
of this class, initialized with an ogg input stream, logical streams
may be acquired and decoded.
To get logical streams from this ogg stream, there are several methods,
which all are compatible with eachother:
getLogicalStream(). This
method will block until a logical input stream becomes available. (If
the ogg stream is chained, that may be after a given amount of data
is read. You can check, whether logical streams are available with
isLogicalStreamAvailable(). Note also, that after getting
the logical stream, that stream is 'consumed', that is, it won't be
returned next time the method is called, and also, the other methods
for getting logical streams will not report it.getLogicalInputStreams().
This is practical to use when the ogg stream is newly allocated, as there
may be more logical streams available then. Calling this method also
'consumes' all returned logical streams, which won't be returned by
other methods neither.
| Constructor Summary | |
|---|---|
OggInputStream(java.io.InputStream stream)
Construct the ogg stream with an input stream. |
|
| Method Summary | |
|---|---|
int |
available()
Method is proxied to given stream. |
void |
close()
Close this stream. |
LogicalStreamListener |
getListener()
|
LogicalInputStream |
getLogicalInputStream()
Get the next logical stream. |
java.util.Collection |
getLogicalInputStreams()
Get all logical streams which are currently available without blocking. |
boolean |
isLogicalStreamAvailable()
Ask whether the next call to getLogicalInputStream()
will block or not. |
int |
read()
Method is proxied to given stream. |
int |
read(byte[] b)
Method is proxied to given stream. |
int |
read(byte[] b,
int offset,
int length)
Method is proxied to given stream. |
void |
setListener(LogicalStreamListener listener)
|
void |
waitForClose()
This method blocks until the end of stream is reached. |
| Methods inherited from class java.io.InputStream |
|---|
mark, markSupported, reset, skip |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OggInputStream(java.io.InputStream stream)
throws java.io.IOException
stream - The stream to decode as an ogg stream.
java.io.IOException - If pre-read fails.| Method Detail |
|---|
public boolean isLogicalStreamAvailable()
getLogicalInputStream()
will block or not.
getLogicalInputStream()
will not block.public LogicalInputStream getLogicalInputStream()
public void waitForClose()
getLogicalInputStream(),
and isLogicalStreamAvailable() methods, when using this
method.
public java.util.Collection getLogicalInputStreams()
throws java.io.IOException
java.io.IOException - If an I/O error occurs.
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.InputStreamjava.io.IOException - If an I/O error occurs.
public int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOException - If an I/O error occurs.
public int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException - If an I/O error occurs.
public int read(byte[] b)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException - If an I/O error occurs.
public int read(byte[] b,
int offset,
int length)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException - If an I/O error occurs.public LogicalStreamListener getListener()
public void setListener(LogicalStreamListener listener)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||