Class VectorCoder<T>

  • All Implemented Interfaces:
    S2Coder<java.util.List<T>>

    @GwtCompatible
    public class VectorCoder<T>
    extends java.lang.Object
    implements S2Coder<java.util.List<T>>
    An encoder/decoder of Lists.
    • Constructor Detail

      • VectorCoder

        public VectorCoder​(S2Coder<T> coder)
        Constructs a VectorCoder which encodes/decodes elements with the given coder.
    • Method Detail

      • encode

        public void encode​(java.util.List<T> values,
                           java.io.OutputStream output)
                    throws java.io.IOException
        Description copied from interface: S2Coder
        Encodes value to output.
        Specified by:
        encode in interface S2Coder<T>
        Throws:
        java.io.IOException
      • decode

        public java.util.List<T> decode​(PrimitiveArrays.Bytes data,
                                        PrimitiveArrays.Cursor cursor)
        Description copied from interface: S2Coder
        Decodes a value of type S2Coder from data starting at cursor.position. cursor.position is updated to the position of the first byte in data following the encoded value.
        Specified by:
        decode in interface S2Coder<T>