Package com.mongodb.connection
Class ByteBufferBsonOutput
- java.lang.Object
-
- java.io.OutputStream
-
- org.bson.io.OutputBuffer
-
- com.mongodb.connection.ByteBufferBsonOutput
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
,BsonOutput
@Deprecated public class ByteBufferBsonOutput extends OutputBuffer
Deprecated.This class should not be considered as part of the public API, and it may change or be removed at any time.
-
-
Field Summary
Fields Modifier and Type Field Description static int
INITIAL_BUFFER_SIZE
Deprecated.static int
MAX_BUFFER_SIZE
Deprecated.
-
Constructor Summary
Constructors Constructor Description ByteBufferBsonOutput(BufferProvider bufferProvider)
Deprecated.Construct an instance that uses the given buffer provider to allocate byte buffers as needs as it grows.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
close()
Deprecated.java.util.List<ByteBuf>
getByteBuffers()
Deprecated.Get a list of byte buffers that are prepared to be read from; in other words, whose position is 0 and whose limit is the number of bytes that should read.int
getPosition()
Deprecated.Gets the current position in the stream.int
getSize()
Deprecated.Gets the current size of the stream in number of bytes.int
pipe(java.io.OutputStream out)
Deprecated.Pipe the contents of this output buffer into the given output streamvoid
truncateToPosition(int newPosition)
Deprecated.Truncates this stream to the new position.void
writeByte(int value)
Deprecated.Write a single byte to the stream.void
writeBytes(byte[] bytes, int offset, int length)
Deprecated.Writeslength
bytes from the byte array, starting atoffset
.-
Methods inherited from class org.bson.io.OutputBuffer
size, toByteArray, toString, write, write, write, writeBytes, writeCString, writeDouble, writeInt, writeInt32, writeInt32, writeInt64, writeLong, writeObjectId, writeString
-
-
-
-
Field Detail
-
INITIAL_BUFFER_SIZE
public static final int INITIAL_BUFFER_SIZE
Deprecated.- See Also:
- Constant Field Values
-
MAX_BUFFER_SIZE
public static final int MAX_BUFFER_SIZE
Deprecated.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ByteBufferBsonOutput
public ByteBufferBsonOutput(BufferProvider bufferProvider)
Deprecated.Construct an instance that uses the given buffer provider to allocate byte buffers as needs as it grows.- Parameters:
bufferProvider
- the non-null buffer provider
-
-
Method Detail
-
writeBytes
public void writeBytes(byte[] bytes, int offset, int length)
Deprecated.Description copied from interface:BsonOutput
Writeslength
bytes from the byte array, starting atoffset
.- Parameters:
bytes
- the non-null byte arrayoffset
- the offset to start writing fromlength
- the number of bytes to write
-
writeByte
public void writeByte(int value)
Deprecated.Description copied from interface:BsonOutput
Write a single byte to the stream. The byte to be written is the eight low-order bits of the specified value. The 24 high-order bits of the value are ignored.- Parameters:
value
- the value
-
getPosition
public int getPosition()
Deprecated.Description copied from interface:BsonOutput
Gets the current position in the stream.- Returns:
- the current position
-
getSize
public int getSize()
Deprecated.Description copied from interface:BsonOutput
Gets the current size of the stream in number of bytes.- Returns:
- the size of the stream
-
getByteBuffers
public java.util.List<ByteBuf> getByteBuffers()
Deprecated.Description copied from class:OutputBuffer
Get a list of byte buffers that are prepared to be read from; in other words, whose position is 0 and whose limit is the number of bytes that should read.Note that the byte buffers may be read-only.
- Specified by:
getByteBuffers
in classOutputBuffer
- Returns:
- the non-null list of byte buffers, in LITTLE_ENDIAN order
-
pipe
public int pipe(java.io.OutputStream out) throws java.io.IOException
Deprecated.Description copied from class:OutputBuffer
Pipe the contents of this output buffer into the given output stream- Specified by:
pipe
in classOutputBuffer
- Parameters:
out
- the stream to pipe to- Returns:
- number of bytes written to the stream
- Throws:
java.io.IOException
- if the stream throws an exception
-
truncateToPosition
public void truncateToPosition(int newPosition)
Deprecated.Description copied from interface:BsonOutput
Truncates this stream to the new position. After this call, both size and position will equal the new position.- Specified by:
truncateToPosition
in interfaceBsonOutput
- Specified by:
truncateToPosition
in classOutputBuffer
- Parameters:
newPosition
- the new position, which must be greater than or equal to 0 and less than the current size.
-
close
public void close()
Deprecated.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceBsonOutput
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classOutputBuffer
-
-