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

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by java.io.DataOutputStream
              extended by kr.co.hit.live.web.flex.io.amf.AmfOutputStream
All Implemented Interfaces:
Closeable, DataOutput, Flushable, ObjectOutput
Direct Known Subclasses:
Amf0OutputStream, Amf3OutputStream

public abstract class AmfOutputStream
extends DataOutputStream
implements ObjectOutput


Field Summary
 
Fields inherited from class java.io.DataOutputStream
written
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
AmfOutputStream(OutputStream out)
           
 
Method Summary
protected  int encodeUTF(String s, byte[] buf)
          문자열을 UTF8 byte 배열에 담아 준다. byte 배열은 충분히 커야한다.
protected  byte[] getBuffer(int len)
           
abstract  void reset()
           
abstract  void writeObject(Object obj)
           
protected  void writeS16(int v)
           
protected  void writeU16(int v)
           
protected  void writeU29(int ref)
          AMF U29 타입을 전송한다.
protected  void writeU32(int v)
           
 
Methods inherited from class java.io.DataOutputStream
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 
Methods inherited from class java.io.FilterOutputStream
close, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.ObjectOutput
close, flush, write, write, write
 
Methods inherited from interface java.io.DataOutput
writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 

Constructor Detail

AmfOutputStream

public AmfOutputStream(OutputStream out)
Method Detail

writeObject

public abstract void writeObject(Object obj)
                          throws IOException
Specified by:
writeObject in interface ObjectOutput
Throws:
IOException

reset

public abstract void reset()

getBuffer

protected byte[] getBuffer(int len)

writeS16

protected void writeS16(int v)
                 throws IOException
Throws:
IOException

writeU16

protected void writeU16(int v)
                 throws IOException
Throws:
IOException

writeU32

protected void writeU32(int v)
                 throws IOException
Throws:
IOException

writeU29

protected void writeU29(int ref)
                 throws IOException
AMF U29 타입을 전송한다.

Parameters:
ref -
Throws:
IOException

encodeUTF

protected int encodeUTF(String s,
                        byte[] buf)
                 throws IOException
문자열을 UTF8 byte 배열에 담아 준다. byte 배열은 충분히 커야한다.

Parameters:
s - encoding 대상 문자열
buf - encoding 결과를 담아둘 byte 배열
Returns:
실제 encode된 byte 수
Throws:
IOException


Copyright © 2014. All Rights Reserved.