derez Expert Licensed User Longtime User Jan 19, 2013 #1 I am using Astreams Prefix to send files and found that when using write2 transmission works only partially and files are not sent fully. I wrote this code to get over the problem and it works : Code: Copy count = raf.ReadBytes(buffer, 0, Min(8188,SizeM), position) 'AStreams.Write2(buffer,0,count) 'this write2 doesn't work ... Dim tempbuf(count) As Byte bc.ArrayCopy(buffer,0,tempbuf,0,count) AStreams.Write(tempbuf) Any idea ? I saw a previous complaint here http://www.b4x.com/forum/bugs-wishlist/19849-something-asyncstreams.html#post114532
I am using Astreams Prefix to send files and found that when using write2 transmission works only partially and files are not sent fully. I wrote this code to get over the problem and it works : Code: Copy count = raf.ReadBytes(buffer, 0, Min(8188,SizeM), position) 'AStreams.Write2(buffer,0,count) 'this write2 doesn't work ... Dim tempbuf(count) As Byte bc.ArrayCopy(buffer,0,tempbuf,0,count) AStreams.Write(tempbuf) Any idea ? I saw a previous complaint here http://www.b4x.com/forum/bugs-wishlist/19849-something-asyncstreams.html#post114532
mc73 Well-Known Member Licensed User Longtime User Jan 19, 2013 #2 Checked the java code posted in the thread you linked, I don't see anything wrong, but who knows of course. The user there suggested littleEndian, and I've just check my own aStreams initializations and they are done this way. I don't know, perhaps you could give it a try, if not already done so? Upvote 0
Checked the java code posted in the thread you linked, I don't see anything wrong, but who knows of course. The user there suggested littleEndian, and I've just check my own aStreams initializations and they are done this way. I don't know, perhaps you could give it a try, if not already done so?
derez Expert Licensed User Longtime User Jan 19, 2013 #3 I work with LittleEndian. If both sides use the same way it works also with True, but I found that my PC program wants LittleEndian (B4ppc). The problem above is a mystery since it works with write but not with write2, and they should be the same when setting start = 0 and count. Last edited: Jan 19, 2013 Upvote 0
I work with LittleEndian. If both sides use the same way it works also with True, but I found that my PC program wants LittleEndian (B4ppc). The problem above is a mystery since it works with write but not with write2, and they should be the same when setting start = 0 and count.
mc73 Well-Known Member Licensed User Longtime User Jan 19, 2013 #4 True, so I noticed. Still, there has to be something somewhere, I just can't accept such notes Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jan 20, 2013 #5 Thank you David. It is now fixed: http://www.b4x.com/forum/additional...andomaccessfile-v1-32-bug-fix.html#post147394 Upvote 0
Thank you David. It is now fixed: http://www.b4x.com/forum/additional...andomaccessfile-v1-32-bug-fix.html#post147394