Package org.bson

Class BsonBinaryReader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, BsonReader

    public class BsonBinaryReader
    extends AbstractBsonReader
    A BsonReader implementation that reads from a binary stream of data. This is the most commonly used implementation.
    Since:
    3.0
    • Constructor Detail

      • BsonBinaryReader

        public BsonBinaryReader​(java.nio.ByteBuffer byteBuffer)
        Construct an instance.
        Parameters:
        byteBuffer - the input for this reader
      • BsonBinaryReader

        public BsonBinaryReader​(BsonInput bsonInput)
        Construct an instance.
        Parameters:
        bsonInput - the input for this reader
    • Method Detail

      • close

        public void close()
        Description copied from class: AbstractBsonReader
        Closes the reader.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface BsonReader
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class AbstractBsonReader
      • getBsonInput

        public BsonInput getBsonInput()
        Gets the BSON input backing this instance.
        Returns:
        the BSON input
      • doReadDecimal128

        public Decimal128 doReadDecimal128()
      • doReadStartArray

        public void doReadStartArray()
      • mark

        @Deprecated
        public void mark()
        Deprecated.
        Description copied from interface: BsonReader
        Creates a bookmark in the BsonReader's input The previous mark must be cleared before creating a new one
      • getMark

        public BsonReaderMark getMark()
        Description copied from interface: BsonReader
        Gets a mark representing the current state of the reader.
        Returns:
        the mark
      • reset

        @Deprecated
        public void reset()
        Deprecated.
        Description copied from interface: BsonReader
        Go back to the state at the last mark and removes the mark