public final class DataByteArrayInputStream
extends java.io.InputStream
implements java.io.DataInput
Constructor and Description |
---|
DataByteArrayInputStream()
Creates
WireByteArrayInputStream with a minmalist byte
array |
DataByteArrayInputStream(byte[] buf)
Creates a
StoreByteArrayInputStream . |
DataByteArrayInputStream(ByteSequence sequence)
Creates a
StoreByteArrayInputStream . |
Modifier and Type | Method and Description |
---|---|
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() |
java.lang.String |
readLine() |
long |
readLong() |
int |
readOrIOException() |
short |
readShort() |
int |
readUnsignedByte() |
int |
readUnsignedShort() |
java.lang.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) |
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
arraypublic int size()
public byte[] getRawData()
public void restart(byte[] newBuff)
StoreByteArrayInputStream
to use an new byte
arraynewBuff
- public void restart(ByteSequence sequence)
StoreByteArrayInputStream
to use an new
ByteSequencesequence
- 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 java.io.InputStream
-1
if the end of the
stream has been reached.public int readOrIOException() throws java.io.IOException
java.io.IOException
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.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 java.io.InputStream
public void readFully(byte[] b)
readFully
in interface java.io.DataInput
public void readFully(byte[] b, int off, int len)
readFully
in interface java.io.DataInput
public int skipBytes(int n)
skipBytes
in interface java.io.DataInput
public boolean readBoolean() throws java.io.IOException
readBoolean
in interface java.io.DataInput
java.io.IOException
public byte readByte() throws java.io.IOException
readByte
in interface java.io.DataInput
java.io.IOException
public int readUnsignedByte() throws java.io.IOException
readUnsignedByte
in interface java.io.DataInput
java.io.IOException
public short readShort() throws java.io.IOException
readShort
in interface java.io.DataInput
java.io.IOException
public int readUnsignedShort() throws java.io.IOException
readUnsignedShort
in interface java.io.DataInput
java.io.IOException
public char readChar() throws java.io.IOException
readChar
in interface java.io.DataInput
java.io.IOException
public int readInt() throws java.io.IOException
readInt
in interface java.io.DataInput
java.io.IOException
public long readLong() throws java.io.IOException
readLong
in interface java.io.DataInput
java.io.IOException
public float readFloat() throws java.io.IOException
readFloat
in interface java.io.DataInput
java.io.IOException
public double readDouble() throws java.io.IOException
readDouble
in interface java.io.DataInput
java.io.IOException
public java.lang.String readLine()
readLine
in interface java.io.DataInput
public java.lang.String readUTF() throws java.io.IOException
readUTF
in interface java.io.DataInput
java.io.IOException
Copyright © 2005-2014 Red Hat, Inc.. All Rights Reserved.