|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
com.bigdata.io.DataInputBuffer
public class DataInputBuffer
A fast implementation of DataInput designed to read from a byte[].
DataOutputBuffer,
DataInputStream| Constructor Summary | |
|---|---|
DataInputBuffer(byte[] buf)
Prepare for reading from the byte[]. |
|
DataInputBuffer(byte[] buf,
int off,
int len)
Prepare for reading from the byte[]. |
|
DataInputBuffer(ByteArrayBuffer buf)
Prepare for reading from the buffer. |
|
| Method Summary | |
|---|---|
long |
position()
Report the position of the stream within its slice (relative to the original offset for the backing buffer) |
void |
position(long v)
Reposition the stream within its slice (relative to the original offset for the backing buffer). |
int |
read()
|
int |
read(byte[] a,
int aoff,
int alen)
Overridden for more efficiency. |
boolean |
readBoolean()
|
byte |
readByte()
|
char |
readChar()
|
double |
readDouble()
|
float |
readFloat()
|
void |
readFully(byte[] b)
|
void |
readFully(byte[] a,
int aoff,
int alen)
|
int |
readInt()
|
String |
readLine()
|
long |
readLong()
|
short |
readShort()
|
int |
readUnsignedByte()
|
int |
readUnsignedShort()
|
String |
readUTF()
|
void |
setBuffer(byte[] buf)
Replaces the buffer and resets the offset to zero (0). |
void |
setBuffer(byte[] buf,
int off,
int len)
Replaces the buffer and reset the offset and length to the specified values. |
void |
setBuffer(ByteArrayBuffer buf)
Replaces the buffer reference with ByteArrayBuffer.array() and
resets the offset and length to the ByteArrayBuffer.pos() and the
ByteArrayBuffer.limit() respectively. |
int |
skipBytes(int n)
|
long |
unpackLong()
Unpack a long value from the current buffer position. |
short |
unpackShort()
Unpack a non-negative short value from the input stream. |
| Methods inherited from class java.io.InputStream |
|---|
available, 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 DataInputBuffer(byte[] buf)
buf - The source data.
public DataInputBuffer(byte[] buf,
int off,
int len)
buf - The source data.off - The offset of the first byte to be read.len - The #of bytes available.public DataInputBuffer(ByteArrayBuffer buf)
ByteArrayBuffer.pos() and the ByteArrayBuffer.limit()
will be read.
buf - The buffer.| Method Detail |
|---|
public void setBuffer(byte[] buf)
buf - The new buffer.
public void setBuffer(byte[] buf,
int off,
int len)
buf - The new buffer.off - len - public void setBuffer(ByteArrayBuffer buf)
ByteArrayBuffer.array() and
resets the offset and length to the ByteArrayBuffer.pos() and the
ByteArrayBuffer.limit() respectively.
buf - The buffer.
public boolean readBoolean()
throws IOException
readBoolean in interface DataInputIOException
public int read()
throws IOException
read in class InputStreamIOException
public byte readByte()
throws IOException
readByte in interface DataInputIOException
public char readChar()
throws IOException
readChar in interface DataInputIOException
public double readDouble()
throws IOException
readDouble in interface DataInputIOException
public float readFloat()
throws IOException
readFloat in interface DataInputIOException
public final void readFully(byte[] b)
throws IOException
readFully in interface DataInputIOException
public final void readFully(byte[] a,
int aoff,
int alen)
throws IOException
readFully in interface DataInputIOException
public final int read(byte[] a,
int aoff,
int alen)
throws IOException
read in class InputStreamIOException
public int readInt()
throws IOException
readInt in interface DataInputIOException
public String readLine()
throws IOException
readLine in interface DataInputIOException
public long readLong()
throws IOException
readLong in interface DataInputIOException
public short readShort()
throws IOException
readShort in interface DataInputIOException
public String readUTF()
throws IOException
readUTF in interface DataInputIOException
public int readUnsignedByte()
throws IOException
readUnsignedByte in interface DataInputIOException
public int readUnsignedShort()
throws IOException
readUnsignedShort in interface DataInputIOException
public int skipBytes(int n)
throws IOException
skipBytes in interface DataInputIOException
public final long unpackLong()
throws IOException
IOException
public final short unpackShort()
throws IOException
is - The input stream.
IOException
public long position()
throws IOException
position in interface it.unimi.dsi.fastutil.io.RepositionableStreamIOException
public void position(long v)
throws IOException
position in interface it.unimi.dsi.fastutil.io.RepositionableStreamIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||