|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
java.io.ByteArrayInputStream
org.activemq.io.util.WireByteArrayInputStream
public class WireByteArrayInputStream
Optimized ByteArrayInputStream that can be used more than once. Which is nice.
Field Summary |
---|
Fields inherited from class java.io.ByteArrayInputStream |
---|
buf, count, mark, pos |
Constructor Summary | |
---|---|
WireByteArrayInputStream()
Creates WireByteArrayInputStream with a minmalist byte array |
|
WireByteArrayInputStream(byte[] buf)
Creates a WireByteArrayInputStream . |
|
WireByteArrayInputStream(byte[] buf,
int offset,
int length)
Creates WireByteArrayInputStream that uses buf as its buffer array. |
|
WireByteArrayInputStream(ByteArray ba)
Create a WireByteArrayInputStream that uses a ByteArray |
Method Summary | |
---|---|
int |
available()
|
byte[] |
getRawData()
|
int |
position()
|
int |
read()
Reads the next byte of data from this input stream. |
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes of data into an array of bytes from this input stream. |
void |
restart(byte[] newBuff)
reset the WireByteArrayInputStream to use an new byte array |
void |
restart(byte[] newBuff,
int offset,
int length)
reset the WireByteArrayInputStream to use an new byte array |
Methods inherited from class java.io.ByteArrayInputStream |
---|
close, mark, markSupported, reset, skip |
Methods inherited from class java.io.InputStream |
---|
read |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WireByteArrayInputStream(byte[] buf)
WireByteArrayInputStream
.
buf
- the input buffer.public WireByteArrayInputStream(byte[] buf, int offset, int length)
WireByteArrayInputStream
that uses buf
as its buffer array.
buf
- the input buffer.offset
- the offset in the buffer of the first byte to read.length
- the maximum number of bytes to read from the buffer.public WireByteArrayInputStream(ByteArray ba)
WireByteArrayInputStream
that uses a ByteArray
ba
- public WireByteArrayInputStream()
WireByteArrayInputStream
with a minmalist byte array
Method Detail |
---|
public int position()
public byte[] getRawData()
public void restart(byte[] newBuff, int offset, int length)
WireByteArrayInputStream
to use an new byte array
newBuff
- buffer to useoffset
- the offset in the buffer of the first byte to read.length
- the maximum number of bytes to read from the buffer.public void restart(byte[] newBuff)
WireByteArrayInputStream
to use an new byte array
newBuff
- public int read()
int
in the
range 0
to 255
. If no byte is available because the end of the stream has been
reached, the value -1
is returned.
This read
method cannot block.
read
in class ByteArrayInputStream
-1
if the end of the stream has been reached.public int read(byte[] b, int off, int len)
len
bytes of data into an array of bytes from this input stream.
read
in class ByteArrayInputStream
b
- the buffer into which the data is read.off
- the start offset of the data.len
- the maximum number of bytes read.
-1
if there is no more data because the
end of the stream has been reached.public int available()
available
in class ByteArrayInputStream
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |