kr.co.hit.live.web.flex.io.amf
Class Amf3InputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.io.DataInputStream
              extended by kr.co.hit.live.web.flex.io.amf.AmfInputStream
                  extended by kr.co.hit.live.web.flex.io.amf.Amf3InputStream
All Implemented Interfaces:
Closeable, DataInput, ObjectInput

public class Amf3InputStream
extends AmfInputStream

AMF3 방식으로 입력되는 InputStream으로부터 객체들을 생성한다.

Author:
김형도

Field Summary
protected  List<Object> objectRefTable
           
protected  List<String> stringRefTable
           
protected  List<ObjectTraits> traitsRefTable
           
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
Amf3InputStream(InputStream in)
           
 
Method Summary
protected  Object convertScriptObject(Object flexObj)
          Flex에서 전송된 몇몇 객체들은 Flex 고유의 자료 구조를 가지고 있으므로 이를 Java 객체 형태로 변환한다.
protected  Object getStoredObject(int ref)
          U29 값이 Object reference인 경우에는 objectRefTable에서 찾아 해당 object를 반환하고, 아닌 경우에는 null을 반환한다.
protected  String getStoredString(int ref)
          U29 값이 String reference인 경우에는 stringRefTable에서 찾아 해당 String을 반환하고, 아닌 경우에는 null을 반환한다.
protected  Object readArray()
          Array format을 Map(ECMA Array인 경우) 또는 Object[](일반 Array인 경우) 객체로 반환한다.
protected  Object readASObject()
          Read ActionScript Object
protected  byte[] readByteArray()
           
protected  Date readDate()
           
protected  void readExternalizable(String className, Object object)
           
 Object readObject()
          InputStream으로부터 객체를 생성하여 반환한다.
protected  ObjectTraits readObjectTraits(int ref)
          object-type = U29 = 000XXXXX XXXXXXXX XXXXXXXX XXXX????
protected  String readString()
           
 void reset()
           
 
Methods inherited from class kr.co.hit.live.web.flex.io.amf.AmfInputStream
getBuffer, readNull, readS16, readU16, readU29, readU32, readU8
 
Methods inherited from class java.io.DataInputStream
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytes
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.ObjectInput
available, close, read, read, read, skip
 
Methods inherited from interface java.io.DataInput
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes
 

Field Detail

stringRefTable

protected List<String> stringRefTable

objectRefTable

protected List<Object> objectRefTable

traitsRefTable

protected List<ObjectTraits> traitsRefTable
Constructor Detail

Amf3InputStream

public Amf3InputStream(InputStream in)
Method Detail

reset

public void reset()
Overrides:
reset in class FilterInputStream

readObject

public Object readObject()
                  throws IOException,
                         ClassNotFoundException
Description copied from class: AmfInputStream
InputStream으로부터 객체를 생성하여 반환한다.

Specified by:
readObject in interface ObjectInput
Specified by:
readObject in class AmfInputStream
Throws:
IOException
ClassNotFoundException

readASObject

protected Object readASObject()
                       throws IOException,
                              ClassNotFoundException
Read ActionScript Object

Returns:
Throws:
IOException
ClassNotFoundException

readObjectTraits

protected ObjectTraits readObjectTraits(int ref)
                                 throws IOException
object-type = U29 = 000XXXXX XXXXXXXX XXXXXXXX XXXX???? XXXXXXX0 : Object Reference, XXXXXXX1 : Object Instance XXXXXX01 : Traits Reference, XXXXXX11 : Traits Instance XXXXX111 : Externalizable XXXX0011 : Static XXXX1011 : Dynamic

Throws:
IOException

convertScriptObject

protected Object convertScriptObject(Object flexObj)
Flex에서 전송된 몇몇 객체들은 Flex 고유의 자료 구조를 가지고 있으므로 이를 Java 객체 형태로 변환한다.

Parameters:
flexObj -
Returns:

readExternalizable

protected void readExternalizable(String className,
                                  Object object)
                           throws ClassNotFoundException,
                                  IOException
Throws:
ClassNotFoundException
IOException

readArray

protected Object readArray()
                    throws IOException,
                           ClassNotFoundException
Array format을 Map(ECMA Array인 경우) 또는 Object[](일반 Array인 경우) 객체로 반환한다. associative array는 name/value 가 반복되고 마지막은 empty string으로 끝남. 그 다음에 dense array가 오는데 value들만 반복됨 associative array는 Map 객체에 담고, dense array는 배열로 담는다. associative array와 dense array가 같이 정의되어 있는 경우는 우선 map으로 처리한다.

Returns:
Throws:
ClassNotFoundException
IOException

readString

protected String readString()
                     throws IOException
Returns:
Throws:
IOException

readByteArray

protected byte[] readByteArray()
                        throws IOException
Throws:
IOException

readDate

protected Date readDate()
                 throws IOException
Throws:
IOException

getStoredString

protected String getStoredString(int ref)
U29 값이 String reference인 경우에는 stringRefTable에서 찾아 해당 String을 반환하고, 아닌 경우에는 null을 반환한다.

Parameters:
ref -
Returns:

getStoredObject

protected Object getStoredObject(int ref)
U29 값이 Object reference인 경우에는 objectRefTable에서 찾아 해당 object를 반환하고, 아닌 경우에는 null을 반환한다.

Parameters:
ref -
Returns:


Copyright © 2014. All Rights Reserved.