Package org.bson.io
Class ByteBufferBsonInput
- java.lang.Object
-
- org.bson.io.ByteBufferBsonInput
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,BsonInput
@Deprecated(since="2022-10-31") public class ByteBufferBsonInput extends java.lang.Object implements BsonInput
Deprecated.Usage of this API is not supported in AEM as a Cloud Service.An implementation ofBsonInputthat is backed by aByteBuf.- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description ByteBufferBsonInput(ByteBuf buffer)Deprecated.Construct an instance with the given byte buffer.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()Deprecated.BsonInputMarkgetMark(int readLimit)Deprecated.Gets a mark for the current position in the stream.intgetPosition()Deprecated.Gets the current position in the streambooleanhasRemaining()Deprecated.Returns true if there are more bytes left in the stream.voidmark(int readLimit)Deprecated.bytereadByte()Deprecated.Reads a single byte from the streamvoidreadBytes(byte[] bytes)Deprecated.Reads the specified number of bytes into the given byte array.voidreadBytes(byte[] bytes, int offset, int length)Deprecated.Reads the specified number of bytes into the given byte array starting at the specified offset.java.lang.StringreadCString()Deprecated.Reads a BSON CString value from the stream.doublereadDouble()Deprecated.Reads a BSON Double value from the stream.intreadInt32()Deprecated.Reads a BSON Int32 value from the stream.longreadInt64()Deprecated.Reads a BSON Int64 value from the stream.ObjectIdreadObjectId()Deprecated.Reads a BSON ObjectId value from the stream.java.lang.StringreadString()Deprecated.Reads a BSON String value from the stream.voidreset()Deprecated.voidskip(int numBytes)Deprecated.Skips the specified number of bytes in the stream.voidskipCString()Deprecated.Skips a BSON CString value from the stream.
-
-
-
Constructor Detail
-
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 Detail
-
getPosition
public int getPosition()
Deprecated.Description copied from interface:BsonInputGets the current position in the stream- Specified by:
getPositionin interfaceBsonInput- Returns:
- the current position
-
readByte
public byte readByte()
Deprecated.Description copied from interface:BsonInputReads a single byte from the stream
-
readBytes
public void readBytes(byte[] bytes)
Deprecated.Description copied from interface:BsonInputReads the specified number of bytes into the given byte array. This is equivalent to toreadBytes(bytes, 0, bytes.length).
-
readBytes
public void readBytes(byte[] bytes, int offset, int length)Deprecated.Description copied from interface:BsonInputReads the specified number of bytes into the given byte array starting at the specified offset.
-
readInt64
public long readInt64()
Deprecated.Description copied from interface:BsonInputReads a BSON Int64 value from the stream.
-
readDouble
public double readDouble()
Deprecated.Description copied from interface:BsonInputReads a BSON Double value from the stream.- Specified by:
readDoublein interfaceBsonInput- Returns:
- the double value
-
readInt32
public int readInt32()
Deprecated.Description copied from interface:BsonInputReads a BSON Int32 value from the stream.
-
readObjectId
public ObjectId readObjectId()
Deprecated.Description copied from interface:BsonInputReads a BSON ObjectId value from the stream.- Specified by:
readObjectIdin interfaceBsonInput- Returns:
- the ObjectId
-
readString
public java.lang.String readString()
Deprecated.Description copied from interface:BsonInputReads a BSON String value from the stream.- Specified by:
readStringin interfaceBsonInput- Returns:
- the string
-
readCString
public java.lang.String readCString()
Deprecated.Description copied from interface:BsonInputReads a BSON CString value from the stream.- Specified by:
readCStringin interfaceBsonInput- Returns:
- the CString
-
skipCString
public void skipCString()
Deprecated.Description copied from interface:BsonInputSkips a BSON CString value from the stream.- Specified by:
skipCStringin interfaceBsonInput
-
skip
public void skip(int numBytes)
Deprecated.Description copied from interface:BsonInputSkips the specified number of bytes in the stream.
-
mark
@Deprecated public void mark(int readLimit)
Deprecated.Description copied from interface:BsonInputMarks the current position in the stream. This method obeys the contract as specified in the same method inInputStream.
-
getMark
public BsonInputMark getMark(int readLimit)
Deprecated.Description copied from interface:BsonInputGets a mark for the current position in the stream.
-
reset
@Deprecated public void reset()
Deprecated.Description copied from interface:BsonInputResets the stream to the current mark. This method obeys the contract as specified in the same method inInputStream.
-
hasRemaining
public boolean hasRemaining()
Deprecated.Description copied from interface:BsonInputReturns true if there are more bytes left in the stream.- Specified by:
hasRemainingin interfaceBsonInput- Returns:
- true if there are more bytes left in the stream.
-
-