Package com.yahoo.io

Class Blob


  • public class Blob
    extends java.lang.Object
    A Blob contains opaque data in the form of a byte array.
    • Constructor Summary

      Constructors 
      Constructor Description
      Blob()
      Create a Blob containing an empty byte array.
      Blob​(byte[] src)
      Create a Blob containing a copy of the given byte array.
      Blob​(byte[] src, int offset, int length)
      Create a Blob containg a copy of a subset of the given byte array.
      Blob​(Blob src)
      Create a Blob containing a copy of the data held by the given blob.
      Blob​(java.nio.ByteBuffer src)
      Create a Blob containing all bytes that could be read from a byte buffer.
      Blob​(java.nio.ByteBuffer src, int length)
      Create a Blob containing a number of bytes read from a byte buffer.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] get()
      Obtain the internal data held by this object.
      void write​(java.nio.ByteBuffer dst)
      Write the data held by this object to the given byte buffer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Blob

        public Blob()
        Create a Blob containing an empty byte array.
      • Blob

        public Blob​(byte[] src,
                    int offset,
                    int length)
        Create a Blob containg a copy of a subset of the given byte array.
      • Blob

        public Blob​(byte[] src)
        Create a Blob containing a copy of the given byte array.
      • Blob

        public Blob​(Blob src)
        Create a Blob containing a copy of the data held by the given blob.
      • Blob

        public Blob​(java.nio.ByteBuffer src,
                    int length)
        Create a Blob containing a number of bytes read from a byte buffer.
      • Blob

        public Blob​(java.nio.ByteBuffer src)
        Create a Blob containing all bytes that could be read from a byte buffer.
    • Method Detail

      • get

        public byte[] get()
        Obtain the internal data held by this object.
        Returns:
        internal data
      • write

        public void write​(java.nio.ByteBuffer dst)
        Write the data held by this object to the given byte buffer.
        Parameters:
        dst - where to write the contained data