|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
com.sibvisions.util.io.MagicByteInputStream
public class MagicByteInputStream
The MagicByteInputStream
is an InputStream
wrapper which reads some magic
bytes from the end of the stream. It will read the byte sequence until found.
Field Summary |
---|
Fields inherited from class java.io.FilterInputStream |
---|
in |
Constructor Summary | |
---|---|
MagicByteInputStream(java.io.InputStream pStream,
byte[] pMagic)
Creates a new instance of MagicByteInputStream for the given stream
and magic byte(s). |
|
MagicByteInputStream(java.io.InputStream pStream,
byte[] pMagic,
boolean pAutoEOF)
Creates a new instance of MagicByteInputStream for the given stream
and optional sets EOF if magic byte was detected. |
Method Summary | |
---|---|
void |
close()
|
int |
read()
|
int |
read(byte[] pContent,
int pOffset,
int pLength)
|
void |
readMagicByte()
Reads until the magic byte was found. |
Methods inherited from class java.io.FilterInputStream |
---|
available, mark, markSupported, read, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MagicByteInputStream(java.io.InputStream pStream, byte[] pMagic)
MagicByteInputStream
for the given stream
and magic byte(s).
pStream
- the wrapped streampMagic
- the magic byte sequencepublic MagicByteInputStream(java.io.InputStream pStream, byte[] pMagic, boolean pAutoEOF)
MagicByteInputStream
for the given stream
and optional sets EOF if magic byte was detected.
pStream
- the wrapped streampMagic
- the magic byte sequencepAutoEOF
- true
to set EOF if magic byte was foundMethod Detail |
---|
public int read() throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public int read(byte[] pContent, int pOffset, int pLength) throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.FilterInputStream
java.io.IOException
public void readMagicByte() throws java.io.IOException
java.io.IOException
- if reading failed or EOF reached and magic byte wasn't found
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |