Class ByteReader


  • public class ByteReader
    extends java.lang.Object
    A ByteArrayDataInput wrapper that tracks the current byte array index.
    • Constructor Summary

      Constructors 
      Constructor Description
      ByteReader​(byte[] bytes, int pos)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int pos()
      The position in the input buffer.
      com.google.common.io.ByteArrayDataInput seek​(int i)  
      void skip​(int n)
      Skips n bytes of input.
      int u1()
      Reads an unsigned 8-bit integer.
      int u2()
      Reads an unsigned 16-bit integer in big-endian byte order.
      int u4()
      Reads an unsigned 32-bit integer in big-endian byte order.
      • Methods inherited from class java.lang.Object

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

      • ByteReader

        public ByteReader​(byte[] bytes,
                          int pos)
    • Method Detail

      • seek

        public com.google.common.io.ByteArrayDataInput seek​(int i)
      • pos

        public int pos()
        The position in the input buffer.
      • u1

        public int u1()
        Reads an unsigned 8-bit integer.
      • u2

        public int u2()
        Reads an unsigned 16-bit integer in big-endian byte order.
      • u4

        public int u4()
        Reads an unsigned 32-bit integer in big-endian byte order.
      • skip

        public void skip​(int n)
        Skips n bytes of input.