Class Base64VLQ


  • public final class Base64VLQ
    extends java.lang.Object
    We encode our variable length numbers as base64 encoded strings with the least significant digit coming first. Each base64 digit encodes a 5-bit value (0-31) and a continuation bit. Signed values can be represented by using the least significant bit of the value as the sign bit.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  Base64VLQ.CharIterator
      A simple interface for advancing through a sequence of characters, that communicates that advance back to the source.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int decode​(Base64VLQ.CharIterator in)
      Decodes the next VLQValue from the provided CharIterator.
      static void encode​(java.lang.Appendable out, int value)
      Writes a VLQ encoded value to the provide appendable.
      • Methods inherited from class java.lang.Object

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

      • encode

        public static void encode​(java.lang.Appendable out,
                                  int value)
                           throws java.io.IOException
        Writes a VLQ encoded value to the provide appendable.
        Throws:
        java.io.IOException
      • decode

        public static int decode​(Base64VLQ.CharIterator in)
        Decodes the next VLQValue from the provided CharIterator.