Class VarSignedLongCodec

java.lang.Object
org.fusesource.hawtbuf.codec.VarLongCodec
org.fusesource.hawtbuf.codec.VarSignedLongCodec
All Implemented Interfaces:
Codec<Long>

public class VarSignedLongCodec extends VarLongCodec
Implementation of a variable length Codec for a signed Long
  • Field Details

  • Constructor Details

    • VarSignedLongCodec

      public VarSignedLongCodec()
  • Method Details

    • encode

      public void encode(Long value, DataOutput dataOut) throws IOException
      Description copied from interface: Codec
      Write the payload of the object to the DataOutput stream.
      Specified by:
      encode in interface Codec<Long>
      Overrides:
      encode in class VarLongCodec
      Parameters:
      value -
      dataOut -
      Throws:
      IOException
    • decode

      public Long decode(DataInput dataIn) throws IOException
      Description copied from interface: Codec
      Read the payload of the object from the DataInput stream.
      Specified by:
      decode in interface Codec<Long>
      Overrides:
      decode in class VarLongCodec
      Parameters:
      dataIn -
      Returns:
      unmarshalled object
      Throws:
      IOException
    • decodeZigZag

      private static long decodeZigZag(long n)
    • encodeZigZag

      private static long encodeZigZag(long n)
    • estimatedSize

      public int estimatedSize(Long value)
      Specified by:
      estimatedSize in interface Codec<Long>
      Overrides:
      estimatedSize in class VarLongCodec
      Parameters:
      value -
      Returns:
      the estimated marshaled size of the object.