|
ModeShape Distribution 3.2.0.Final | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.infinispan.schematic.internal.io.BsonDataInput
public class BsonDataInput
An implementation of DataInput with additional methods needed for reading BSON formatted content from another DataInput
instance. Specifically, this class reads little-endian byte order (purposefully in violation of the DataInput interface
specification) and provides a way to read C-style strings (where the length is not known up front but instead contain all
characters until the zero-byte terminator), which are commonly used within the BSON specification.
| Constructor Summary | |
|---|---|
BsonDataInput(DataInput input)
|
|
| Method Summary | |
|---|---|
int |
getTotalBytesRead()
Returns the number of bytes that have been read from this input. |
protected byte |
read()
|
protected int |
read(byte[] b,
int off,
int len)
|
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()
|
static String |
readUTF(DataInput dis,
int len)
Utility method to read a UTF-8 string from the supplied DataInput object given the supplied number of bytes to read or, if the number of bytes is not known, all of the UTF-8 characters until the next zero-byte value. |
String |
readUTF(int len)
Read a UTF-8 string with the supplied length or, if the length is not known, the UTF-8 characters until the next zero-byte value. |
int |
skipBytes(int n)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BsonDataInput(DataInput input)
| Method Detail |
|---|
public int getTotalBytesRead()
throws IOException
IOException - if an I/O error occurs.
public final int readUnsignedByte()
throws IOException
readUnsignedByte in interface DataInputIOException
public boolean readBoolean()
throws IOException
readBoolean in interface DataInputIOException
public byte readByte()
throws IOException
readByte in interface DataInputIOException
public char readChar()
throws IOException
readChar in interface DataInputIOException
public int readUnsignedShort()
throws IOException
readUnsignedShort in interface DataInputIOException
public short readShort()
throws IOException
readShort in interface DataInputIOException
public int readInt()
throws IOException
readInt in interface DataInputIOException
public long readLong()
throws IOException
readLong in interface DataInputIOException
public float readFloat()
throws IOException
readFloat in interface DataInputIOException
public double readDouble()
throws IOException
readDouble in interface DataInputIOException
public void readFully(byte[] b)
throws IOException
readFully in interface DataInputIOException
public void readFully(byte[] b,
int off,
int len)
throws IOException
readFully in interface DataInputIOException
protected int read(byte[] b,
int off,
int len)
throws IOException
IOException
protected final byte read()
throws IOException
IOException
public int skipBytes(int n)
throws IOException
skipBytes in interface DataInputIOExceptionpublic String readLine()
readLine in interface DataInput
public String readUTF()
throws IOException
readUTF in interface DataInputIOException
public String readUTF(int len)
throws IOException
standard way to read a string, which always expects the
length to be the first value on the stream.
len - the number of bytes to read, or -1 if the length is not known and characters should be read until the next
zero-byte string.
IOException
public static String readUTF(DataInput dis,
int len)
throws IOException
standard way to read a string, which always expects the length to be the first value on the
stream.
dis - the DataInput from which the UTF-8 string is to be readlen - the number of bytes to read, or -1 if the length is not known and characters should be read until the next
zero-byte string.
IOException - if there is a problem reading from the input
|
ModeShape Distribution 3.2.0.Final | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||