Class ByteBufferBsonOutput

    • 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
        Writes length bytes from the byte array, starting at offset.
        Parameters:
        bytes - the non-null byte array
        offset - the offset to start writing from
        length - 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
      • write

        protected void write(int absolutePosition,
                             int value)
        Deprecated.
        Description copied from class: OutputBuffer
        Write the specified byte at the specified position.
        Specified by:
        write in class OutputBuffer
        Parameters:
        absolutePosition - the position, which must be greater than equal to 0 and at least 4 less than the stream size
        value - the value to write. The 24 high-order bits of the value are ignored.
      • getByteBuffers

        public 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 class OutputBuffer
        Returns:
        the non-null list of byte buffers, in LITTLE_ENDIAN order
      • pipe

        public int pipe(OutputStream out)
                 throws IOException
        Deprecated.
        Description copied from class: OutputBuffer
        Pipe the contents of this output buffer into the given output stream
        Specified by:
        pipe in class OutputBuffer
        Parameters:
        out - the stream to pipe to
        Returns:
        number of bytes written to the stream
        Throws:
        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 interface BsonOutput
        Specified by:
        truncateToPosition in class OutputBuffer
        Parameters:
        newPosition - the new position, which must be greater than or equal to 0 and less than the current size.