|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Stream
Interface used by a filter to access the stream flowing through a pipeline.
Method Summary | |
---|---|
int |
available()
Get the number of bytes currently available in the stream. |
byte |
discard()
Discard the byte at the current position in the stream. |
void |
discard(int len)
Discard a given number of bytes from the stream, starting at the current position. |
void |
error(String description)
|
int |
get()
Get the byte at the current position in the stream. |
int |
get(int lookahead)
Get the byte at a given distance from the current position in the stream. |
void |
insert(byte b)
Insert a byte at the current position in the stream. |
void |
insert(byte[] buffer,
int offset,
int length)
Insert a byte sequence at the current position in the stream. |
void |
insert(ByteBuffer buffer)
Insert the content of a byte buffer at the current position in the stream. |
boolean |
isEndOfStream()
Check if the end of the stream has been reached. |
void |
popFilter()
|
void |
pushFilter(StreamFilter filter)
|
int |
read(byte[] buffer,
int offset,
int length)
Read data from the stream into a byte array, starting from the current position in the stream. |
int |
read(ByteBuffer buffer)
Read data from the stream into a byte buffer, starting from the current position in the stream. |
void |
readAll(OutputStream out)
Read all currently available data from the stream and copy it to an OutputStream object. |
byte |
skip()
Skip the byte at the current position in the stream. |
void |
skip(int len)
Skip a given number of bytes in the stream, starting from the current position. |
void |
skipAll()
Skip all the bytes currently available in the stream. |
Method Detail |
---|
int available()
boolean isEndOfStream()
int get()
ArrayIndexOutOfBoundsException
- if the byte at the
current position is not yet available. This is the
case if available()
returns 0 and
isEndOfStream()
is returns false.int get(int lookahead)
lookahead
- the distance from the current position
ArrayIndexOutOfBoundsException
- if the byte at the
given position is not yet availableint read(byte[] buffer, int offset, int length)
buffer
- the buffer into which the data is readoffset
- the start offset in array buffer
at which the data is writtenlength
- the maximum number of bytes to read
int read(ByteBuffer buffer)
Buffer.remaining()
.
buffer
- the buffer into which the data is read
void readAll(OutputStream out) throws IOException
OutputStream
object.
Calling this method will not modify the current position in
the stream.
out
- the output stream to write the data to
IOException
- if an I/O error occurred when writing
to the output streambyte discard()
void discard(int len)
len
- the number of bytes to discardvoid insert(byte b)
b
- the byte to insertvoid insert(byte[] buffer, int offset, int length)
buffer
- a byte array containing the sequence to be inserted in the streamoffset
- the start offset in the byte arraylength
- the number of bytes to insertvoid insert(ByteBuffer buffer)
buffer
- the byte buffer containing the sequence to be inserted in the streambyte skip()
void skip(int len)
len
- the number of bytes to skipvoid skipAll()
s.skipAll()
is equivalent to
s.skip(s.available())
.
void pushFilter(StreamFilter filter)
void popFilter()
void error(String description)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |