Class FSTPayloadReader

java.lang.Object
dev.getelements.elements.rt.fst.FSTPayloadReader
All Implemented Interfaces:
PayloadReader

public class FSTPayloadReader extends Object implements PayloadReader
  • Constructor Details

    • FSTPayloadReader

      public FSTPayloadReader()
  • Method Details

    • convert

      public <T> T convert(Class<T> to, Object from)
      Description copied from interface: PayloadReader
      Reads the object to another type.
      Specified by:
      convert in interface PayloadReader
      Type Parameters:
      T - the type
      Parameters:
      to - the type to read
      from - the type from which to read
      Returns:
      an instance of the requested type, read from the supplied object.
    • read

      public <T> T read(Class<T> payloadType, InputStream stream) throws IOException
      Description copied from interface: PayloadReader
      Reads the actual response object to the InputStream.
      Specified by:
      read in interface PayloadReader
      Parameters:
      payloadType - the the response object
      stream - the output stream
      Throws:
      IOException
    • read

      public <T> T read(Class<T> payloadType, byte[] toRead) throws IOException
      Description copied from interface: PayloadReader
      Reads a payload from the supplied byte array. The default implementation of this method uses a temporary ByteArrayInputStream to accomplish the deserialization.
      Specified by:
      read in interface PayloadReader
      Type Parameters:
      T - the type of the payload
      Parameters:
      payloadType - the type of the payload
      toRead - the byte array to read
      Returns:
      the deserialized payload
      Throws:
      IOException
    • getFstConfiguration

      public org.nustaq.serialization.FSTConfiguration getFstConfiguration()
    • setFstConfiguration

      @Inject public void setFstConfiguration(org.nustaq.serialization.FSTConfiguration fstConfiguration)
    • main

      public static void main(String[] args) throws Exception
      Throws:
      Exception