Package org.bson

Class RawBsonArray

  • All Implemented Interfaces:
    , , <<<BsonValue>

    public class RawBsonArray
    extends BsonArray
    implements 
    An immutable BSON array that is represented using only the raw bytes.
    Since:
    3.7
    See Also:
    Serialized Form
    • Constructor Detail

      • RawBsonArray

        public RawBsonArray​(byte[] bytes)
        Constructs a new instance with the given byte array. Note that it does not make a copy of the array, so do not modify it after passing it to this constructor.
        Parameters:
        bytes - the bytes representing a BSON document. Note that the byte array is NOT copied, so care must be taken not to modify it after passing it to this construction, unless of course that is your intention.
      • RawBsonArray

        public RawBsonArray​(byte[] bytes,
                            int offset,
                            int length)
        Constructs a new instance with the given byte array, offset, and length. Note that it does not make a copy of the array, so do not modify it after passing it to this constructor.
        Parameters:
        bytes - the bytes representing a BSON document. Note that the byte array is NOT copied, so care must be taken not to modify it after passing it to this construction, unless of course that is your intention.
        offset - the offset into the byte array
        length - the length of the subarray to use