smorales / cocoon-p2p

Automatically exported from code.google.com/p/cocoon-p2p
0 stars 0 forks source link

bytes must be non-null #11

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi there,

when I connect 2+ devices to the network and send over files, the following 
error consistently crops up.

adding this if clause prevents the crash but files are not successfully copied 
over: if(data.dataVector[i])buffer.writeBytes(data.dataVector[i]);

Would appreciate some help.
best wishes,
Andy.

TypeError: Error #2007: Parameter bytes must be non-null.
    at flash.utils::ByteArray/writeBytes()
    at com.projectcocoon.p2p.managers::ObjectManager/reassembleObject()[C:\Users\Andy\Desktop\xperiment\classes\com\projectcocoon\p2p\managers\ObjectManager.as:261]
    at com.projectcocoon.p2p.managers::ObjectManager/handleResult()[C:\Users\Andy\Desktop\xperiment\classes\com\projectcocoon\p2p\managers\ObjectManager.as:242]
    at com.projectcocoon.p2p.managers::ObjectManager/onNetStatus()[C:\Users\Andy\Desktop\xperiment\classes\com\projectcocoon\p2p\managers\ObjectManager.as:402]

Original issue reported on code.google.com by andytwo...@gmail.com on 18 Nov 2013 at 8:34

GoogleCodeExporter commented 8 years ago
I also like to know how to get the bytes while the copying is in progress... 
currently it's null:

private function objectProgressHandler(event:ObjectEvent):void
{
   var metaData:ObjectMetadataVO = event.metadata;
   metaData.object as ByteArray // is null!
}

if we can access the bytes while in progress, I will be able to write the bytes 
to sdcard while it is transferring which will be a lot helpful on mobile devices

fileStream.writeBytes(metaData.object,0,metaData.object.length);

I would really appriciate if you can give me a small hint on where to look 
at... if you guys don't have the time to do it yourself, I'd be happy to do it 
myself :) but just to speed me up, a little hint would be helpful...

Original comment by taha...@gmail.com on 3 Nov 2014 at 11:39