de.humatic.dsj.src.rtmp
Class AMF

java.lang.Object
  extended by de.humatic.dsj.src.rtmp.AMF

public class AMF
extends java.lang.Object

Defines constants and utility methods for Action Message Format (AMF0) datatransfer


Field Summary
static int BOOL
          AMF0 datatypes
static int BYTE_ARRAY
          AMF0 datatypes
static int DATE
          AMF0 datatypes
static int ECMA_ARRAY
          AMF0 datatypes
static int END
          AMF0 datatypes
static int INT
          AMF0 datatypes
static int LOF_BOOL
          AMF object sizes including type field
static int LOF_INT
          AMF object sizes including type field
static int LOF_NULL
          AMF object sizes including type field
static int LOF_NUM
          AMF object sizes including type field
static int LOF_REF
          AMF object sizes including type field
static int LOF_SWFDATE
          AMF object sizes including type field
static int NULL
          AMF0 datatypes
static int NUM
          AMF0 datatypes
static int OBJECT
          AMF0 datatypes
static int REF
          AMF0 datatypes
static int SHORT
          AMF0 datatypes
static java.lang.String STR_FALSE
           
static java.lang.String STR_TRUE
           
static java.lang.String STR_UNDEFINED
           
static int STRICT_ARRAY
          AMF0 datatypes
static int STRING
          AMF0 datatypes
static int UNDEFINED
          AMF0 datatypes
static int XML
          AMF0 datatypes
 
Constructor Summary
AMF()
           
 
Method Summary
static byte[] createAMFHeader(int length, int AMFNumber, byte[] hb, int objLength, int objType, int AMFDest, byte[] msg)
           
static int encodeBool(boolean val, byte[] cont, int pos)
           
static int encodeInt(int value, byte[] cont, int pos)
           
static int encodeNull(byte[] cont, int pos)
           
static int encodeNum(long value, byte[] cont, int pos)
           
static int encodeShort(int value, byte[] cont, int pos)
           
static int encodeString(java.lang.String s, boolean prependCode, byte[] cont, int pos)
           
static int objectLength(byte[] data, int pos, int max)
           
static java.lang.String readString(byte[] data, int pos)
          Returns String encoded in the given byte array, assuming %pos points to the size field two bytes before the String.
static int writeObjectEnd(int pos, byte[] cont)
           
static int writeObjectStart(int pos, byte[] cont)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUM

public static final int NUM
AMF0 datatypes

See Also:
Constant Field Values

BOOL

public static final int BOOL
AMF0 datatypes

See Also:
Constant Field Values

STRING

public static final int STRING
AMF0 datatypes

See Also:
Constant Field Values

OBJECT

public static final int OBJECT
AMF0 datatypes

See Also:
Constant Field Values

INT

public static final int INT
AMF0 datatypes

See Also:
Constant Field Values

NULL

public static final int NULL
AMF0 datatypes

See Also:
Constant Field Values

UNDEFINED

public static final int UNDEFINED
AMF0 datatypes

See Also:
Constant Field Values

REF

public static final int REF
AMF0 datatypes

See Also:
Constant Field Values

ECMA_ARRAY

public static final int ECMA_ARRAY
AMF0 datatypes

See Also:
Constant Field Values

END

public static final int END
AMF0 datatypes

See Also:
Constant Field Values

STRICT_ARRAY

public static final int STRICT_ARRAY
AMF0 datatypes

See Also:
Constant Field Values

DATE

public static final int DATE
AMF0 datatypes

See Also:
Constant Field Values

XML

public static final int XML
AMF0 datatypes

See Also:
Constant Field Values

BYTE_ARRAY

public static final int BYTE_ARRAY
AMF0 datatypes

See Also:
Constant Field Values

SHORT

public static final int SHORT
AMF0 datatypes

See Also:
Constant Field Values

LOF_NULL

public static final int LOF_NULL
AMF object sizes including type field

See Also:
Constant Field Values

LOF_BOOL

public static final int LOF_BOOL
AMF object sizes including type field

See Also:
Constant Field Values

LOF_INT

public static final int LOF_INT
AMF object sizes including type field

See Also:
Constant Field Values

LOF_NUM

public static final int LOF_NUM
AMF object sizes including type field

See Also:
Constant Field Values

LOF_REF

public static final int LOF_REF
AMF object sizes including type field

See Also:
Constant Field Values

LOF_SWFDATE

public static final int LOF_SWFDATE
AMF object sizes including type field

See Also:
Constant Field Values

STR_UNDEFINED

public static final java.lang.String STR_UNDEFINED
See Also:
Constant Field Values

STR_TRUE

public static final java.lang.String STR_TRUE
See Also:
Constant Field Values

STR_FALSE

public static final java.lang.String STR_FALSE
See Also:
Constant Field Values
Constructor Detail

AMF

public AMF()
Method Detail

objectLength

public static int objectLength(byte[] data,
                               int pos,
                               int max)

encodeNum

public static int encodeNum(long value,
                            byte[] cont,
                            int pos)

encodeShort

public static int encodeShort(int value,
                              byte[] cont,
                              int pos)

encodeInt

public static int encodeInt(int value,
                            byte[] cont,
                            int pos)

encodeBool

public static int encodeBool(boolean val,
                             byte[] cont,
                             int pos)

encodeString

public static int encodeString(java.lang.String s,
                               boolean prependCode,
                               byte[] cont,
                               int pos)

encodeNull

public static int encodeNull(byte[] cont,
                             int pos)

writeObjectStart

public static int writeObjectStart(int pos,
                                   byte[] cont)

writeObjectEnd

public static int writeObjectEnd(int pos,
                                 byte[] cont)

readString

public static java.lang.String readString(byte[] data,
                                          int pos)
Returns String encoded in the given byte array, assuming %pos points to the size field two bytes before the String.


createAMFHeader

public static byte[] createAMFHeader(int length,
                                     int AMFNumber,
                                     byte[] hb,
                                     int objLength,
                                     int objType,
                                     int AMFDest,
                                     byte[] msg)