Package org.bson.io
Class Bits
- java.lang.Object
- 
- org.bson.io.Bits
 
- 
 @Deprecated public class Bits extends Object Deprecated.there is no replacement for this utility classUtility class for reading values from an input stream.
- 
- 
Constructor SummaryConstructors Constructor Description Bits()Deprecated.
 - 
Method SummaryAll Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidreadFully(InputStream inputStream, byte[] buffer)Deprecated.Reads bytes from the input stream and puts them into the given byte buffer.static voidreadFully(InputStream inputStream, byte[] buffer, int length)Deprecated.Reads bytes from the input stream and puts them into the given byte buffer.static voidreadFully(InputStream inputStream, byte[] buffer, int offset, int length)Deprecated.Reads bytes from the input stream and puts them into the given byte buffer.static intreadInt(byte[] buffer)Deprecated.Reads and returns a single integer value from the buffer.static intreadInt(byte[] buffer, int offset)Deprecated.Reads and returns a single integer value from the buffer.static intreadInt(InputStream inputStream)Deprecated.Reads and returns a single integer value from the input stream.static intreadInt(InputStream inputStream, byte[] buffer)Deprecated.Reads and returns a single integer value from the input stream.static intreadIntBE(byte[] buffer, int offset)Deprecated.Reads and returns a single big-endian integer valuestatic longreadLong(byte[] buffer)Deprecated.Reads and returns a single long value from the buffer.static longreadLong(byte[] buffer, int offset)Deprecated.Reads and returns a single long value from the buffer.static longreadLong(InputStream inputStream)Deprecated.Reads and returns a single long value from the input stream.static longreadLong(InputStream inputStream, byte[] buffer)Deprecated.Reads and returns a single long value from the input stream.
 
- 
- 
- 
Method Detail- 
readFullypublic static void readFully(InputStream inputStream, byte[] buffer) throws IOException Deprecated.Reads bytes from the input stream and puts them into the given byte buffer. The equivalent of callingreadFully(java.io.InputStream, byte[], int, int)with an offset of zero and a length equal to the length of the buffer.- Parameters:
- inputStream- the input stream to read from
- buffer- the buffer into which the data is read.
- Throws:
- IOException- if there's an error reading from the- inputStream
 
 - 
readFullypublic static void readFully(InputStream inputStream, byte[] buffer, int length) throws IOException Deprecated.Reads bytes from the input stream and puts them into the given byte buffer. The equivalent of callingreadFully(java.io.InputStream, byte[], int, int)with an offset of zero.- Parameters:
- inputStream- the input stream to read from
- buffer- the buffer into which the data is read.
- length- the maximum number of bytes to read.
- Throws:
- IOException- if there's an error reading from the- inputStream
 
 - 
readFullypublic static void readFully(InputStream inputStream, byte[] buffer, int offset, int length) throws IOException Deprecated.Reads bytes from the input stream and puts them into the given byte buffer.- Parameters:
- inputStream- the input stream to read from
- buffer- the buffer into which the data is read.
- offset- the start offset in array- bufferat which the data is written.
- length- the maximum number of bytes to read.
- Throws:
- IOException- if there's an error reading from the- inputStream
- See Also:
- InputStream.read(byte[], int, int)
 
 - 
readIntpublic static int readInt(InputStream inputStream) throws IOException Deprecated.Reads and returns a single integer value from the input stream.- Parameters:
- inputStream- the input stream to read from
- Returns:
- the integer value
- Throws:
- IOException- if there's an error reading from the- inputStream
 
 - 
readIntpublic static int readInt(InputStream inputStream, byte[] buffer) throws IOException Deprecated.Reads and returns a single integer value from the input stream.- Parameters:
- inputStream- the input stream to read from
- buffer- the buffer to write the input stream bytes into
- Returns:
- the integer value
- Throws:
- IOException- if there's an error reading from the- inputStream
 
 - 
readIntpublic static int readInt(byte[] buffer) Deprecated.Reads and returns a single integer value from the buffer. The equivalent of callingreadInt(byte[], int)with an offset of zero.- Parameters:
- buffer- the buffer to read from
- Returns:
- the integer value
 
 - 
readIntpublic static int readInt(byte[] buffer, int offset)Deprecated.Reads and returns a single integer value from the buffer.- Parameters:
- buffer- the buffer to read from
- offset- the position to start reading from the buffer
- Returns:
- the integer value
 
 - 
readIntBEpublic static int readIntBE(byte[] buffer, int offset)Deprecated.Reads and returns a single big-endian integer value- Parameters:
- buffer- the buffer to read from
- offset- the position to start reading from the buffer
- Returns:
- the integer value
 
 - 
readLongpublic static long readLong(InputStream inputStream) throws IOException Deprecated.Reads and returns a single long value from the input stream.- Parameters:
- inputStream- the input stream to read from
- Returns:
- the long value
- Throws:
- IOException- if there's an error reading from the- inputStream
 
 - 
readLongpublic static long readLong(InputStream inputStream, byte[] buffer) throws IOException Deprecated.Reads and returns a single long value from the input stream.- Parameters:
- inputStream- the input stream to read from
- buffer- the buffer to write the input stream bytes into
- Returns:
- the long value
- Throws:
- IOException- if there's an error reading from the- inputStream
 
 - 
readLongpublic static long readLong(byte[] buffer) Deprecated.Reads and returns a single long value from the buffer. The equivalent of calledreadLong(byte[], int)with an offset of zero.- Parameters:
- buffer- the buffer to read from
- Returns:
- the long value
 
 - 
readLongpublic static long readLong(byte[] buffer, int offset)Deprecated.Reads and returns a single long value from the buffer.- Parameters:
- buffer- the buffer to read from
- offset- the position to start reading from the buffer
- Returns:
- the long value
 
 
- 
 
-