Package gnu.lists

Class Blob

  • All Implemented Interfaces:
    BoundedHashable, Array<UByte>, AVector<UByte>, Consumable, GVector<UByte>, Sequence<UByte>, java.io.Externalizable, java.io.Serializable, java.lang.CharSequence, java.lang.Comparable, java.lang.Iterable<UByte>, java.util.Collection<UByte>, java.util.List<UByte>, java.util.RandomAccess

    public class Blob
    extends U8Vector
    implements java.lang.CharSequence
    Binary data which may represent text or other information. It can be used for the contents of a Unix-style file or pipe, which is commonly but not always text, so whether it should be treated as bytes, text, or something else is context-dependent. (Nowadays you'd want an associated MIME-type, but that is not always provided.) The acronym "blob" has been taken as "binary large object", but in this case it isn't necessary large.
    See Also:
    Serialized Form
    • Constructor Detail

      • Blob

        public Blob​(byte[] data)
      • Blob

        public Blob​(byte[] data,
                    java.nio.charset.Charset charset)
    • Method Detail

      • wrap

        public static Blob wrap​(byte[] data,
                                int size)
      • asPlainBytevector

        public U8Vector asPlainBytevector()
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface java.lang.CharSequence
        Overrides:
        toString in class AbstractSequence<UByte>
      • charAt

        public char charAt​(int index)
        Specified by:
        charAt in interface java.lang.CharSequence
      • length

        public int length()
        Specified by:
        length in interface java.lang.CharSequence
      • subSequence

        public java.lang.CharSequence subSequence​(int start,
                                                  int end)
        Specified by:
        subSequence in interface java.lang.CharSequence