Package org.bson.io

Class Bits


  • @Deprecated
    public class Bits
    extends Object
    Deprecated.
    there is no replacement for this utility class
    Utility class for reading values from an input stream.
    • Constructor Summary

      Constructors 
      Constructor Description
      Bits()
      Deprecated.
       
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static void readFully​(InputStream inputStream, byte[] buffer)
      Deprecated.
      Reads bytes from the input stream and puts them into the given byte buffer.
      static void readFully​(InputStream inputStream, byte[] buffer, int length)
      Deprecated.
      Reads bytes from the input stream and puts them into the given byte buffer.
      static void readFully​(InputStream inputStream, byte[] buffer, int offset, int length)
      Deprecated.
      Reads bytes from the input stream and puts them into the given byte buffer.
      static int readInt​(byte[] buffer)
      Deprecated.
      Reads and returns a single integer value from the buffer.
      static int readInt​(byte[] buffer, int offset)
      Deprecated.
      Reads and returns a single integer value from the buffer.
      static int readInt​(InputStream inputStream)
      Deprecated.
      Reads and returns a single integer value from the input stream.
      static int readInt​(InputStream inputStream, byte[] buffer)
      Deprecated.
      Reads and returns a single integer value from the input stream.
      static int readIntBE​(byte[] buffer, int offset)
      Deprecated.
      Reads and returns a single big-endian integer value
      static long readLong​(byte[] buffer)
      Deprecated.
      Reads and returns a single long value from the buffer.
      static long readLong​(byte[] buffer, int offset)
      Deprecated.
      Reads and returns a single long value from the buffer.
      static long readLong​(InputStream inputStream)
      Deprecated.
      Reads and returns a single long value from the input stream.
      static long readLong​(InputStream inputStream, byte[] buffer)
      Deprecated.
      Reads and returns a single long value from the input stream.
    • Constructor Detail

      • Bits

        public Bits()
        Deprecated.
    • Method Detail

      • readFully

        public 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 calling readFully(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
      • readFully

        public 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 calling readFully(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
      • readFully

        public 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 buffer at 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)
      • readInt

        public 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
      • readInt

        public 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
      • readInt

        public static int readInt​(byte[] buffer)
        Deprecated.
        Reads and returns a single integer value from the buffer. The equivalent of calling readInt(byte[], int) with an offset of zero.
        Parameters:
        buffer - the buffer to read from
        Returns:
        the integer value
      • readInt

        public 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
      • readIntBE

        public 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
      • readLong

        public 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
      • readLong

        public 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
      • readLong

        public static long readLong​(byte[] buffer)
        Deprecated.
        Reads and returns a single long value from the buffer. The equivalent of called readLong(byte[], int) with an offset of zero.
        Parameters:
        buffer - the buffer to read from
        Returns:
        the long value
      • readLong

        public 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