Package org.bson.io
Interface BsonInput
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
ByteBufferBsonInput
Deprecated.
Usage of this API is not supported in AEM as a Cloud Service.
An input stream that is optimized for reading BSON values directly from the underlying stream.
- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Deprecated.getMark(int readLimit) Deprecated.Gets a mark for the current position in the stream.intDeprecated.Gets the current position in the streambooleanDeprecated.Returns true if there are more bytes left in the stream.voidmark(int readLimit) Deprecated.UsegetMark(int)insteadbytereadByte()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.Deprecated.Reads a BSON CString value from the stream.doubleDeprecated.Reads a BSON Double value from the stream.intDeprecated.Reads a BSON Int32 value from the stream.longDeprecated.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.voidreset()Deprecated.PrefergetMark(int)voidskip(int numBytes) Deprecated.Skips the specified number of bytes in the stream.voidDeprecated.Skips a BSON CString value from the stream.
-
Method Details
-
getPosition
int getPosition()Deprecated.Gets the current position in the stream- Returns:
- the current position
-
readByte
byte readByte()Deprecated.Reads a single byte from the stream- Returns:
- the byte value
-
readBytes
void readBytes(byte[] bytes) Deprecated.Reads the specified number of bytes into the given byte array. This is equivalent to toreadBytes(bytes, 0, bytes.length).- Parameters:
bytes- the byte array to write into
-
readBytes
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.- Parameters:
bytes- the byte array to write intooffset- the offset to start writinglength- the number of bytes to write
-
readInt64
long readInt64()Deprecated.Reads a BSON Int64 value from the stream.- Returns:
- the Int64 value
-
readDouble
double readDouble()Deprecated.Reads a BSON Double value from the stream.- Returns:
- the double value
-
readInt32
int readInt32()Deprecated.Reads a BSON Int32 value from the stream.- Returns:
- the Int32 value
-
readString
String readString()Deprecated.Reads a BSON String value from the stream.- Returns:
- the string
-
readObjectId
ObjectId readObjectId()Deprecated.Reads a BSON ObjectId value from the stream.- Returns:
- the ObjectId
-
readCString
String readCString()Deprecated.Reads a BSON CString value from the stream.- Returns:
- the CString
-
skipCString
void skipCString()Deprecated.Skips a BSON CString value from the stream. -
skip
void skip(int numBytes) Deprecated.Skips the specified number of bytes in the stream.- Parameters:
numBytes- the number of bytes to skip
-
mark
Deprecated.UsegetMark(int)insteadMarks the current position in the stream. This method obeys the contract as specified in the same method inInputStream.- Parameters:
readLimit- the maximum limit of bytes that can be read before the mark position becomes invalid
-
getMark
Deprecated.Gets a mark for the current position in the stream.- Parameters:
readLimit- the maximum limit of bytes that can be read before the mark position becomes invalid- Returns:
- the mark
- Since:
- 3.7
-
reset
Deprecated.PrefergetMark(int)Resets the stream to the current mark. This method obeys the contract as specified in the same method inInputStream. -
hasRemaining
boolean hasRemaining()Deprecated.Returns true if there are more bytes left in the stream.- Returns:
- true if there are more bytes left in the stream.
-
close
void close()Deprecated.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-