|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.ws.commons.tcpmon.core.filter.ReadOnlyStream
public class ReadOnlyStream
Constructor Summary | |
---|---|
ReadOnlyStream(Stream parent)
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReadOnlyStream(Stream parent)
Method Detail |
---|
public int available()
Stream
available
in interface Stream
public byte discard()
Stream
discard
in interface Stream
public void discard(int len)
Stream
discard
in interface Stream
len
- the number of bytes to discardpublic int get()
Stream
get
in interface Stream
public int get(int lookahead)
Stream
get
in interface Stream
lookahead
- the distance from the current position
public void insert(byte b)
Stream
insert
in interface Stream
b
- the byte to insertpublic void insert(byte[] buffer, int offset, int length)
Stream
insert
in interface Stream
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 insertpublic void insert(ByteBuffer buffer)
Stream
insert
in interface Stream
buffer
- the byte buffer containing the sequence to be inserted in the streampublic boolean isEndOfStream()
Stream
isEndOfStream
in interface Stream
public int read(byte[] buffer, int offset, int length)
Stream
read
in interface Stream
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
public int read(ByteBuffer buffer)
Stream
Buffer.remaining()
.
read
in interface Stream
buffer
- the buffer into which the data is read
public void readAll(OutputStream out) throws IOException
Stream
OutputStream
object.
Calling this method will not modify the current position in
the stream.
readAll
in interface Stream
out
- the output stream to write the data to
IOException
- if an I/O error occurred when writing
to the output streampublic byte skip()
Stream
skip
in interface Stream
public void skip(int len)
Stream
skip
in interface Stream
len
- the number of bytes to skippublic void skipAll()
Stream
s.skipAll()
is equivalent to
s.skip(s.available())
.
skipAll
in interface Stream
public void pushFilter(StreamFilter filter)
pushFilter
in interface Stream
public void popFilter()
popFilter
in interface Stream
public void error(String description)
error
in interface Stream
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |