Hello Alehi,

This may not be a bug. ByteArray types was introduced in AMF3, at the same time as Action Script 3 was introduced in Flash . Are you sure your flash script exchanges with Red5 using AMF3 serialized objects ?

Cheers.

--
Max.

Alehi a écrit :
When i'm trying to return ByteArray from Red5 to Flash i have next error:
     java.lang.RuntimeException: ByteArray objects not supported with AMF0

Flash script:
public function init():void { private var nc:NetConnection; nc = new NetConnection();
       nc.objectEncoding = ObjectEncoding.AMF3;
       nc.client = this;
       nc.connect("http://localhost:5080/myapp/gateway/xo";);
var nc_responder:Responder = new Responder(getServerResponse, getServerStatus); nc.call("getImage", nc_responder);

Method on Red5:
public ByteArray getAvatar() {
ByteArray byteArray = new ByteArray(); String fileName = "test.jpg"; FileInputStream fileInputStream;
        try {
            byte[] buff = new byte[8192];
            fileInputStream = new FileInputStream(fileName);
            BufferedInputStream bufferedInputStream = new 
BufferedInputStream(fileInputStream);
            while (bufferedInputStream.read(buff) != -1) {
                byteArray.writeBytes(buff);
            }
        } catch (Exception e) {
            System.out.println("Error.");
} return byteArray;
    }

When i'm connecting to red5 using RTMP or RTMPT it's ok.
Is it a bug?

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org



_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to