Class Codecs.AbstractCodec

    • Constructor Detail

      • AbstractCodec

        public AbstractCodec()
    • Method Detail

      • encode

        public void encode​(PofWriter out,
                           int index,
                           Object value)
                    throws IOException
        Serialize an object using the provided PofWriter.
        Specified by:
        encode in interface Codec
        Parameters:
        out - the PofWriter to read from
        index - the index of the POF property to serialize
        value - the value to serialize
        Throws:
        IOException - if an I/O error occurs
      • newInstance

        protected static <T> T newInstance​(Class<T> clz)
        Return a new instance of T based on the provided Class<T>, or throw a RuntimeException.
        Type Parameters:
        T - the type to instantiate and return
        Parameters:
        clz - the class to instantiate
        Returns:
        a new instance of type T