Class ByteBuffer


  • public class ByteBuffer
    extends java.lang.Object
    • Field Detail

      • bytes

        private static final byte[] bytes
      • count

        protected int count
      • buffer

        private byte[] buffer
    • Constructor Detail

      • ByteBuffer

        public ByteBuffer()
      • ByteBuffer

        public ByteBuffer​(int size)
    • Method Detail

      • getHex

        public static int getHex​(int v)
      • append

        public ByteBuffer append​(byte[] b,
                                 int off,
                                 int len)
      • append

        public ByteBuffer append​(java.lang.String str)
      • appendHex

        public ByteBuffer appendHex​(byte b)
      • get

        public byte get​(int index)
      • getInternalBuffer

        public byte[] getInternalBuffer()
      • size

        public int size()
      • isEmpty

        public boolean isEmpty()
      • capacity

        public int capacity()
      • toByteArray

        public byte[] toByteArray​(int off,
                                  int len)
      • toByteArray

        public byte[] toByteArray()
      • startsWith

        public boolean startsWith​(byte[] b)
      • prepend

        ByteBuffer prepend​(byte b)
        Fill ByteBuffer from the end. Set byte at capacity() - size() - 1 position.
        Parameters:
        b - byte.
        Returns:
        ByteBuffer.
      • prepend

        ByteBuffer prepend​(byte[] b)
        Fill ByteBuffer from the end. Set bytes from capacity() - size() - b.length position.
        Parameters:
        b - byte.
        Returns:
        ByteBuffer.