GangXu / as3-stomp

Automatically exported from code.google.com/p/as3-stomp
0 stars 0 forks source link

ByteReader class scan method uses length instead of bytesAvailable #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
public  var buffer:ByteArrayReader = new ByteArrayReader();
buffer.writeUTF("This is text in a buffer");
buffer.forwardBy(buffer.bytesAvailable);
var x:int = scanit(0x00);

What is the expected output? What do you see instead?
x should contain -1, contains 0, scan is looping through unitialised 
memory so results could be unpredictable

What version of the product are you using? On what operating system?
r8

Please provide any additional information below.

I've got a patch for this and for some other issues I'm working on. If 
it's any use let me know where and I can upload them.

Many thanks

Peter Mulreid

Original issue reported on code.google.com by peter.mu...@gmail.com on 19 Mar 2008 at 12:03

GoogleCodeExporter commented 8 years ago
code should read:

public  var buffer:ByteArrayReader = new ByteArrayReader();
buffer.writeUTF("This is text in a buffer");
buffer.forwardBy(buffer.bytesAvailable);
var x:int = buffer.scan(0x00);

sorry

Original comment by peter.mu...@gmail.com on 19 Mar 2008 at 12:04

GoogleCodeExporter commented 8 years ago
Thanks Peter.  If you'd like I could add you to this project so that you could 
commit
the patch directly.  Or if you'd prefer, you could attach the patch to this 
ticket.

Thanks again,

Derek

Original comment by dwischu...@gmail.com on 19 Mar 2008 at 3:25

GoogleCodeExporter commented 8 years ago

Original comment by dwischu...@gmail.com on 20 Mar 2008 at 2:35

GoogleCodeExporter commented 8 years ago
Fixed, see comment for revision 9: 
http://code.google.com/p/as3-stomp/source/detail?r=9

I will update the download files soon.

Original comment by dwischu...@gmail.com on 30 Mar 2008 at 6:38