Package org.bson

Interface BSONDecoder

    • Method Detail

      • readObject

        BSONObject readObject​(byte[] bytes)
        Read a single BSON object from the given bytes.
        Parameters:
        bytes - the bytes in BSON format
        Returns:
        the BSON object for the given bytes
      • readObject

        BSONObject readObject​(InputStream in)
                       throws IOException
        Read a single BSON object from the given input stream.
        Parameters:
        in - the input stream in BSON format
        Returns:
        the BSON object for the given bytes
        Throws:
        IOException - if there's a problem reading the object from the InputStream
      • decode

        int decode​(byte[] bytes,
                   BSONCallback callback)
        Decode a single BSON object into the given callback from the given byte array.
        Parameters:
        bytes - the bytes in BSON format
        callback - the callback
        Returns:
        the number of bytes in the BSON object
      • decode

        int decode​(InputStream in,
                   BSONCallback callback)
            throws IOException
        Decode a single BSON object into the given callback from the given input stream.
        Parameters:
        in - the input stream in BSON format
        callback - the callback
        Returns:
        the number of bytes read from the input stream
        Throws:
        IOException - if there's a problem reading from the InputStream