Package org.bson.io

Class ByteBufferBsonInput

java.lang.Object
org.bson.io.ByteBufferBsonInput
All Implemented Interfaces:
Closeable, AutoCloseable, BsonInput

@Deprecated(since="2022-10-31") public class ByteBufferBsonInput extends Object implements BsonInput
Deprecated.
Usage of this API is not supported in AEM as a Cloud Service.
An implementation of BsonInput that is backed by a ByteBuf.
Since:
3.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
    Construct an instance with the given byte buffer.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated.
     
    getMark(int readLimit)
    Deprecated.
    Gets a mark for the current position in the stream.
    int
    Deprecated.
    Gets the current position in the stream
    boolean
    Deprecated.
    Returns true if there are more bytes left in the stream.
    void
    mark(int readLimit)
    Deprecated.
    byte
    Deprecated.
    Reads a single byte from the stream
    void
    readBytes(byte[] bytes)
    Deprecated.
    Reads the specified number of bytes into the given byte array.
    void
    readBytes(byte[] bytes, int offset, int length)
    Deprecated.
    Reads the specified number of bytes into the given byte array starting at the specified offset.
    Deprecated.
    Reads a BSON CString value from the stream.
    double
    Deprecated.
    Reads a BSON Double value from the stream.
    int
    Deprecated.
    Reads a BSON Int32 value from the stream.
    long
    Deprecated.
    Reads a BSON Int64 value from the stream.
    Deprecated.
    Reads a BSON ObjectId value from the stream.
    Deprecated.
    Reads a BSON String value from the stream.
    void
    Deprecated.
    void
    skip(int numBytes)
    Deprecated.
    Skips the specified number of bytes in the stream.
    void
    Deprecated.
    Skips a BSON CString value from the stream.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ByteBufferBsonInput

      public ByteBufferBsonInput(ByteBuf buffer)
      Deprecated.
      Construct an instance with the given byte buffer. The stream takes over ownership of the buffer and closes it when this instance is closed.
      Parameters:
      buffer - the byte buffer
  • Method Details

    • getPosition

      public int getPosition()
      Deprecated.
      Description copied from interface: BsonInput
      Gets the current position in the stream
      Specified by:
      getPosition in interface BsonInput
      Returns:
      the current position
    • readByte

      public byte readByte()
      Deprecated.
      Description copied from interface: BsonInput
      Reads a single byte from the stream
      Specified by:
      readByte in interface BsonInput
      Returns:
      the byte value
    • readBytes

      public void readBytes(byte[] bytes)
      Deprecated.
      Description copied from interface: BsonInput
      Reads the specified number of bytes into the given byte array. This is equivalent to to readBytes(bytes, 0, bytes.length).
      Specified by:
      readBytes in interface BsonInput
      Parameters:
      bytes - the byte array to write into
    • readBytes

      public void readBytes(byte[] bytes, int offset, int length)
      Deprecated.
      Description copied from interface: BsonInput
      Reads the specified number of bytes into the given byte array starting at the specified offset.
      Specified by:
      readBytes in interface BsonInput
      Parameters:
      bytes - the byte array to write into
      offset - the offset to start writing
      length - the number of bytes to write
    • readInt64

      public long readInt64()
      Deprecated.
      Description copied from interface: BsonInput
      Reads a BSON Int64 value from the stream.
      Specified by:
      readInt64 in interface BsonInput
      Returns:
      the Int64 value
    • readDouble

      public double readDouble()
      Deprecated.
      Description copied from interface: BsonInput
      Reads a BSON Double value from the stream.
      Specified by:
      readDouble in interface BsonInput
      Returns:
      the double value
    • readInt32

      public int readInt32()
      Deprecated.
      Description copied from interface: BsonInput
      Reads a BSON Int32 value from the stream.
      Specified by:
      readInt32 in interface BsonInput
      Returns:
      the Int32 value
    • readObjectId

      public ObjectId readObjectId()
      Deprecated.
      Description copied from interface: BsonInput
      Reads a BSON ObjectId value from the stream.
      Specified by:
      readObjectId in interface BsonInput
      Returns:
      the ObjectId
    • readString

      public String readString()
      Deprecated.
      Description copied from interface: BsonInput
      Reads a BSON String value from the stream.
      Specified by:
      readString in interface BsonInput
      Returns:
      the string
    • readCString

      public String readCString()
      Deprecated.
      Description copied from interface: BsonInput
      Reads a BSON CString value from the stream.
      Specified by:
      readCString in interface BsonInput
      Returns:
      the CString
    • skipCString

      public void skipCString()
      Deprecated.
      Description copied from interface: BsonInput
      Skips a BSON CString value from the stream.
      Specified by:
      skipCString in interface BsonInput
    • skip

      public void skip(int numBytes)
      Deprecated.
      Description copied from interface: BsonInput
      Skips the specified number of bytes in the stream.
      Specified by:
      skip in interface BsonInput
      Parameters:
      numBytes - the number of bytes to skip
    • mark

      @Deprecated public void mark(int readLimit)
      Deprecated.
      Description copied from interface: BsonInput
      Marks the current position in the stream. This method obeys the contract as specified in the same method in InputStream.
      Specified by:
      mark in interface BsonInput
      Parameters:
      readLimit - the maximum limit of bytes that can be read before the mark position becomes invalid
    • getMark

      public BsonInputMark getMark(int readLimit)
      Deprecated.
      Description copied from interface: BsonInput
      Gets a mark for the current position in the stream.
      Specified by:
      getMark in interface BsonInput
      Parameters:
      readLimit - the maximum limit of bytes that can be read before the mark position becomes invalid
      Returns:
      the mark
    • reset

      @Deprecated public void reset()
      Deprecated.
      Description copied from interface: BsonInput
      Resets the stream to the current mark. This method obeys the contract as specified in the same method in InputStream.
      Specified by:
      reset in interface BsonInput
    • hasRemaining

      public boolean hasRemaining()
      Deprecated.
      Description copied from interface: BsonInput
      Returns true if there are more bytes left in the stream.
      Specified by:
      hasRemaining in interface BsonInput
      Returns:
      true if there are more bytes left in the stream.
    • close

      public void close()
      Deprecated.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface BsonInput
      Specified by:
      close in interface Closeable