|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
org.apache.activemq.util.DataByteArrayInputStream
public final class DataByteArrayInputStream
Optimized ByteArrayInputStream that can be used more than once
Constructor Summary | |
---|---|
DataByteArrayInputStream()
Creates WireByteArrayInputStream with a minmalist byte
array |
|
DataByteArrayInputStream(byte[] buf)
Creates a StoreByteArrayInputStream . |
|
DataByteArrayInputStream(ByteSequence sequence)
Creates a StoreByteArrayInputStream . |
Method Summary | |
---|---|
int |
available()
|
byte[] |
getRawData()
|
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. |
boolean |
readBoolean()
|
byte |
readByte()
|
char |
readChar()
|
double |
readDouble()
|
float |
readFloat()
|
void |
readFully(byte[] b)
|
void |
readFully(byte[] b,
int off,
int len)
|
int |
readInt()
|
String |
readLine()
|
long |
readLong()
|
short |
readShort()
|
int |
readUnsignedByte()
|
int |
readUnsignedShort()
|
String |
readUTF()
|
void |
restart(byte[] newBuff)
reset the StoreByteArrayInputStream to use an new byte
array |
void |
restart(ByteSequence sequence)
reset the StoreByteArrayInputStream to use an new
ByteSequence |
void |
restart(int size)
re-start the input stream - reusing the current buffer |
int |
size()
|
int |
skipBytes(int n)
|
Methods inherited from class java.io.InputStream |
---|
close, 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 DataByteArrayInputStream(byte[] buf)
StoreByteArrayInputStream
.
buf
- the input buffer.public DataByteArrayInputStream(ByteSequence sequence)
StoreByteArrayInputStream
.
sequence
- the input buffer.public DataByteArrayInputStream()
WireByteArrayInputStream
with a minmalist byte
array
Method Detail |
---|
public int size()
public byte[] getRawData()
public void restart(byte[] newBuff)
StoreByteArrayInputStream
to use an new byte
array
newBuff
- public void restart(ByteSequence sequence)
StoreByteArrayInputStream
to use an new
ByteSequence
sequence
- public void restart(int size)
size
- 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 InputStream
-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 InputStream
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 InputStream
public void readFully(byte[] b)
readFully
in interface DataInput
public void readFully(byte[] b, int off, int len)
readFully
in interface DataInput
public int skipBytes(int n)
skipBytes
in interface DataInput
public boolean readBoolean()
readBoolean
in interface DataInput
public byte readByte()
readByte
in interface DataInput
public int readUnsignedByte()
readUnsignedByte
in interface DataInput
public short readShort()
readShort
in interface DataInput
public int readUnsignedShort()
readUnsignedShort
in interface DataInput
public char readChar()
readChar
in interface DataInput
public int readInt()
readInt
in interface DataInput
public long readLong()
readLong
in interface DataInput
public float readFloat() throws IOException
readFloat
in interface DataInput
IOException
public double readDouble() throws IOException
readDouble
in interface DataInput
IOException
public String readLine()
readLine
in interface DataInput
public String readUTF() throws IOException
readUTF
in interface DataInput
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |