Class AMF3Utils


  • public class AMF3Utils
    extends Object

    AMF3 utilities

    • Constructor Summary

      Constructors 
      Constructor Description
      AMF3Utils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Date deserializeDate​(java.nio.ByteBuffer data)
      Deserialize date type
      static int deserializeInt​(java.nio.ByteBuffer data)
      Deserialize int
      static String deserializeString​(java.nio.ByteBuffer data)
      Deserialize string
      static String deserializeString​(java.nio.ByteBuffer data, int utflen)
      Deserialize string
      static String deserializeString​(java.nio.ByteBuffer data, AMFDataContextDeserialize context)
      Deserialize string
      static int serializeDate​(java.io.DataOutputStream out, java.util.Date date)
      Serialize a date object
      static int serializeInt​(java.io.DataOutputStream out, int val)
      Serialize int value
      static int serializeString​(java.io.DataOutputStream out, String str)
      Serialize a string value
      static int serializeStringNoLength​(java.io.DataOutputStream out, String str)
      Serialize string but do not write the length
      static void serializeZeroLengthString​(java.io.DataOutputStream out)
      Serialize empty string
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AMF3Utils

        public AMF3Utils()
    • Method Detail

      • deserializeDate

        public static java.util.Date deserializeDate​(java.nio.ByteBuffer data)
        Deserialize date type
        Parameters:
        data - buffer
        Returns:
        date
      • serializeDate

        public static int serializeDate​(java.io.DataOutputStream out,
                                        java.util.Date date)
        Serialize a date object
        Parameters:
        out - output stream
        date - date
        Returns:
        number of bytes written
      • deserializeInt

        public static int deserializeInt​(java.nio.ByteBuffer data)
        Deserialize int
        Parameters:
        data - buffer
        Returns:
        int value
      • serializeInt

        public static int serializeInt​(java.io.DataOutputStream out,
                                       int val)
        Serialize int value
        Parameters:
        out - output stream
        val - int value
        Returns:
        number of bytes written
      • deserializeString

        public static String deserializeString​(java.nio.ByteBuffer data,
                                               AMFDataContextDeserialize context)
                                        throws java.io.IOException
        Deserialize string
        Parameters:
        data - data
        context - AMF context
        Returns:
        string value
        Throws:
        java.io.IOException
      • deserializeString

        public static String deserializeString​(java.nio.ByteBuffer data)
                                        throws java.io.IOException
        Deserialize string
        Parameters:
        data - data
        Returns:
        string value
        Throws:
        java.io.IOException
      • deserializeString

        public static String deserializeString​(java.nio.ByteBuffer data,
                                               int utflen)
                                        throws java.io.IOException
        Deserialize string
        Parameters:
        data - data
        utflen - len of the string
        Returns:
        string value
        Throws:
        java.io.IOException
      • serializeZeroLengthString

        public static void serializeZeroLengthString​(java.io.DataOutputStream out)
        Serialize empty string
        Parameters:
        out - output stream
      • serializeStringNoLength

        public static int serializeStringNoLength​(java.io.DataOutputStream out,
                                                  String str)
                                           throws java.io.IOException
        Serialize string but do not write the length
        Parameters:
        out - output stream
        str - string value
        Returns:
        number of bytes written
        Throws:
        java.io.IOException
      • serializeString

        public static int serializeString​(java.io.DataOutputStream out,
                                          String str)
                                   throws java.io.IOException
        Serialize a string value
        Parameters:
        out - output stream
        str - string value
        Returns:
        number of bytes written
        Throws:
        java.io.IOException