Package gnu.lists

Class ByteVector<E>

All Implemented Interfaces:
BoundedHashable, Array<E>, AVector<E>, Consumable, GVector<E>, Sequence<E>, Externalizable, Serializable, Comparable, Iterable<E>, Collection<E>, List<E>, RandomAccess, SequencedCollection<E>
Direct Known Subclasses:
S8Vector, U8Vector

public abstract class ByteVector<E> extends PrimIntegerVector<E>
Simple adjustable-length vector of signed or unsigned 8-bit integers (bytes).
See Also:
  • Field Details

    • empty

      protected static byte[] empty
  • Constructor Details

    • ByteVector

      public ByteVector()
  • Method Details

    • getBufferLength

      public int getBufferLength()
      Get the allocated length of the data buffer.
      Specified by:
      getBufferLength in class SimpleVector<E>
    • copyBuffer

      public void copyBuffer(int length)
      Specified by:
      copyBuffer in class SimpleVector<E>
    • getBuffer

      public byte[] getBuffer()
      Specified by:
      getBuffer in class SimpleVector<E>
    • setBuffer

      protected void setBuffer(Object buffer)
      Specified by:
      setBuffer in class SimpleVector<E>
    • getByte

      public final byte getByte(int index)
    • getByteRaw

      public final byte getByteRaw(int index)
      Specified by:
      getByteRaw in interface Array<E>
      Overrides:
      getByteRaw in class AbstractSequence<E>
    • setByte

      public final void setByte(int index, byte value)
    • setByteRaw

      public final void setByteRaw(int index, byte value)
    • add

      public void add(byte v)
    • clearBuffer

      protected void clearBuffer(int start, int count)
      Specified by:
      clearBuffer in class SimpleVector<E>
    • readFrom

      public int readFrom(int start, int count, InputStream in) throws IOException
      Throws:
      IOException
    • writeTo

      public void writeTo(OutputStream out) throws IOException
      Throws:
      IOException
    • writeTo

      public void writeTo(int start, int count, OutputStream out) throws IOException
      Throws:
      IOException
    • copyFrom

      public void copyFrom(int index, ByteVector src, int start, int end)
    • getInputStream

      public InputStream getInputStream()
    • utf8ToString

      public String utf8ToString(int start, int length)
      Covert bytes, interpreted as UTF-8 characters, to a String.
    • utf16ToString

      public String utf16ToString(int start, int length)
    • utf16ToString

      public String utf16ToString(int start, int length, boolean bigEndian)