Package 

Interface ByteArrayBuffer

  • All Implemented Interfaces:

    
    public interface ByteArrayBuffer
    
                        

    A simple interface that encapsulates all the information needed for byte buffer access.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Array<byte> getBuffer() Gets the byte buffer that supports this instance.
      abstract int getOffset() Gets the offset in the byte buffer where the actual data starts.
      abstract int getLength() Gets the length of the data in the buffer.
      abstract void setLength(int len) Sets the length of the data in the buffer.
      abstract void setOffset(int off) Sets the offset of the data in the buffer.
      abstract boolean isInvalid() Perform checks on the byte buffer represented by this instance and return true if it is found to be invalid.
      abstract void readRegionToBuff(int off, int len, Array<byte> outBuf) Copies len bytes from the given offset in this buffer to the given outBuf
      abstract void grow(int howMuch) Increases the size of this buffer by howMuch.
      abstract void append(Array<byte> data, int len) Appends len bytes from data to the end of this buffer.
      abstract void shrink(int len) Shrinks the length of this buffer by len
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • getBuffer

         abstract Array<byte> getBuffer()

        Gets the byte buffer that supports this instance.

      • getOffset

         abstract int getOffset()

        Gets the offset in the byte buffer where the actual data starts.

      • getLength

         abstract int getLength()

        Gets the length of the data in the buffer.

      • setLength

         abstract void setLength(int len)

        Sets the length of the data in the buffer.

        Parameters:
        len - the length of the data in the buffer.
      • setOffset

         abstract void setOffset(int off)

        Sets the offset of the data in the buffer.

        Parameters:
        off - the offset of the data in the buffer.
      • isInvalid

         abstract boolean isInvalid()

        Perform checks on the byte buffer represented by this instance and return true if it is found to be invalid.

      • readRegionToBuff

         abstract void readRegionToBuff(int off, int len, Array<byte> outBuf)

        Copies len bytes from the given offset in this buffer to the given outBuf

        Parameters:
        off - the offset relative to the beginning of this buffer's data from where to start copying.
        len - the number of bytes to copy.
        outBuf - the array to copy to
      • grow

         abstract void grow(int howMuch)

        Increases the size of this buffer by howMuch. This may result in a new byte[] to be allocated if the existing one is not large enough.

      • append

         abstract void append(Array<byte> data, int len)

        Appends len bytes from data to the end of this buffer. This grows the buffer and as a result a new byte[] may be allocated.

      • shrink

         abstract void shrink(int len)

        Shrinks the length of this buffer by len