Skip to content

Commit

Permalink
Fixed a bug of read zero length bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
andot committed Aug 8, 2014
1 parent 858620e commit 8c9e724
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Binary file modified dist/hprose_as3.swc
Binary file not shown.
6 changes: 4 additions & 2 deletions src/hprose/io/HproseReader.as
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* *
* hprose reader class for ActionScript 3.0. *
* *
* LastModified: Mar 8, 2014 *
* LastModified: Aug 8, 2014 *
* Author: Ma Bingyao <andot@hprose.com> *
* *
\**********************************************************/
Expand Down Expand Up @@ -283,7 +283,9 @@ package hprose.io {
public function readBytesWithoutTag():ByteArray {
var count:int = readInt(HproseTags.TagQuote);
var bytes:ByteArray = new ByteArray();
stream.readBytes(bytes, 0, count);
if (count > 0) {
stream.readBytes(bytes, 0, count);
}
bytes.position = 0;
stream.readByte();
refer.set(bytes);
Expand Down

0 comments on commit 8c9e724

Please sign in to comment.