Class ByteArrayBuffer

    • Constructor Detail

      • ByteArrayBuffer

        public ByteArrayBuffer()
      • ByteArrayBuffer

        public ByteArrayBuffer​(byte[] bytes)
      • ByteArrayBuffer

        public ByteArrayBuffer​(byte[] bytes,
                               int copyBufferSize)
    • Method Detail

      • getBytes

        public byte[] getBytes()
      • append

        public ByteArrayBuffer append​(byte[] bytes,
                                      int startPosition,
                                      int len)
      • length

        public int length()
      • subArray

        public byte[] subArray​(int beginIndex,
                               int endIndex)
        The intest of this method is to be similar to String.substring(int, int) Returns a new byte[] that is a sub-array of this array. The sub-array begins at the specified beginIndex and extends to the byte at index endIndex - 1. Thus the length of the sub-array is endIndex-beginIndex.
        Parameters:
        beginIndex - the beginning index, inclusive.
        endIndex - the ending index, exclusive.
        Returns:
        the specified substring.
        Throws:
        IndexOutOfBoundsException - if the beginIndex is negative, or endIndex is larger than the length of this byte[], or beginIndex is larger than endIndex.
      • indexOf

        public int indexOf​(byte b)
      • indexOf

        public int indexOf​(byte b,
                           int fromIndex)
      • lastIndexOf

        public int lastIndexOf​(byte b)
      • lastIndexOf

        public int lastIndexOf​(byte b,
                               int fromIndex)
      • toHex

        public String toHex()
      • split

        public List<byte[]> split​(byte[] pattern)
      • split

        public List<byte[]> split​(byte[] pattern,
                                  int limit)