Class EmptyByteSequence

  • All Implemented Interfaces:
    ByteSequence

    final class EmptyByteSequence
    extends java.lang.Object
    implements ByteSequence
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static byte[] EMPTY_BYTES  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte byteAt​(int index)
      Returns the byte value at the specified index.
      int length()
      Returns the length of this byte sequence.
      byte[] toByteArray()
      Copies the contents of this byte sequence into a newly allocated byte array and returns that array.
      • Methods inherited from class java.lang.Object

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

      • EMPTY_BYTES

        private static final byte[] EMPTY_BYTES
    • Constructor Detail

      • EmptyByteSequence

        EmptyByteSequence()
    • Method Detail

      • length

        public int length()
        Description copied from interface: ByteSequence
        Returns the length of this byte sequence.
        Specified by:
        length in interface ByteSequence
        Returns:
        the number of bytes in this sequence.
      • byteAt

        public byte byteAt​(int index)
        Description copied from interface: ByteSequence
        Returns the byte value at the specified index.
        Specified by:
        byteAt in interface ByteSequence
        Parameters:
        index - the index of the byte value to be returned.
        Returns:
        the corresponding byte value
      • toByteArray

        public byte[] toByteArray()
        Description copied from interface: ByteSequence
        Copies the contents of this byte sequence into a newly allocated byte array and returns that array.
        Specified by:
        toByteArray in interface ByteSequence
        Returns:
        a byte array holding a copy of this byte sequence.