|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
org.fusesource.hawtbuf.DataByteArrayInputStream
public final class DataByteArrayInputStream
Optimized ByteArrayInputStream that can be used more than once
| Field Summary | |
|---|---|
protected AbstractVarIntSupport |
helper
|
| Constructor Summary | |
|---|---|
DataByteArrayInputStream()
Creates WireByteArrayInputStream with a minmalist byte
array |
|
DataByteArrayInputStream(Buffer buffer)
Creates a StoreByteArrayInputStream. |
|
DataByteArrayInputStream(byte[] buf)
Creates a StoreByteArrayInputStream. |
|
| Method Summary | |
|---|---|
int |
available()
|
int |
getLength()
|
int |
getPos()
|
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()
|
Buffer |
readBuffer(int len)
|
byte |
readByte()
|
char |
readChar()
|
double |
readDouble()
|
float |
readFloat()
|
void |
readFully(byte[] b)
|
void |
readFully(byte[] b,
int off,
int len)
|
int |
readInt()
|
java.lang.String |
readLine()
|
long |
readLong()
|
short |
readShort()
|
int |
readUnsignedByte()
|
int |
readUnsignedShort()
|
java.lang.String |
readUTF()
|
int |
readVarInt()
|
long |
readVarLong()
|
int |
readVarSignedInt()
|
long |
readVarSignedLong()
|
void |
restart()
|
void |
restart(Buffer buffer)
reset the StoreByteArrayInputStream to use an new
Buffer |
void |
restart(byte[] newBuff)
reset the StoreByteArrayInputStream to use an new byte
array |
void |
restart(int size)
re-start the input stream - reusing the current buffer |
void |
setLength(int length)
|
void |
setPos(int pos)
|
int |
size()
|
int |
skip(int n)
|
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 |
| Field Detail |
|---|
protected AbstractVarIntSupport helper
| Constructor Detail |
|---|
public DataByteArrayInputStream(byte[] buf)
StoreByteArrayInputStream.
buf - the input buffer.public DataByteArrayInputStream(Buffer buffer)
StoreByteArrayInputStream.
buffer - the input buffer.public DataByteArrayInputStream()
WireByteArrayInputStream with a minmalist byte
array
| Method Detail |
|---|
public void restart(Buffer buffer)
StoreByteArrayInputStream to use an new
Buffer
buffer - public void restart(int size)
size - public int size()
public byte[] getRawData()
public Buffer readBuffer(int len)
public void restart(byte[] newBuff)
StoreByteArrayInputStream to use an new byte
array
newBuff - public void restart()
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 java.io.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 java.io.InputStreamb - 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 java.io.InputStreampublic void readFully(byte[] b)
readFully in interface java.io.DataInput
public void readFully(byte[] b,
int off,
int len)
readFully in interface java.io.DataInputpublic int skip(int n)
public int skipBytes(int n)
skipBytes in interface java.io.DataInputpublic boolean readBoolean()
readBoolean in interface java.io.DataInputpublic byte readByte()
readByte in interface java.io.DataInputpublic int readUnsignedByte()
readUnsignedByte in interface java.io.DataInputpublic short readShort()
readShort in interface java.io.DataInputpublic int readUnsignedShort()
readUnsignedShort in interface java.io.DataInputpublic char readChar()
readChar in interface java.io.DataInputpublic int readInt()
readInt in interface java.io.DataInputpublic long readLong()
readLong in interface java.io.DataInput
public float readFloat()
throws java.io.IOException
readFloat in interface java.io.DataInputjava.io.IOException
public double readDouble()
throws java.io.IOException
readDouble in interface java.io.DataInputjava.io.IOExceptionpublic java.lang.String readLine()
readLine in interface java.io.DataInput
public java.lang.String readUTF()
throws java.io.IOException
readUTF in interface java.io.DataInputjava.io.IOExceptionpublic int getPos()
public void setPos(int pos)
public int getLength()
public void setLength(int length)
public int readVarInt()
throws java.io.IOException
java.io.IOException
public long readVarLong()
throws java.io.IOException
java.io.IOException
public int readVarSignedInt()
throws java.io.IOException
java.io.IOException
public long readVarSignedLong()
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||