You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ha...@apache.org on 2016/08/03 07:40:41 UTC
[04/12] git commit: [flex-asjs] [refs/heads/develop] - Fix for UTC
prepended short - respect endianness
Fix for UTC prepended short - respect endianness
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/d12bcddf
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/d12bcddf
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/d12bcddf
Branch: refs/heads/develop
Commit: d12bcddf444da559931b351fd4d93d7648e1758f
Parents: 3efcd71
Author: greg-dove <gr...@gmail.com>
Authored: Sat Jul 23 16:23:49 2016 +1200
Committer: greg-dove <gr...@gmail.com>
Committed: Sat Jul 23 16:23:49 2016 +1200
----------------------------------------------------------------------
.../Core/src/main/flex/org/apache/flex/utils/BinaryData.as | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d12bcddf/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/BinaryData.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/BinaryData.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/BinaryData.as
index 1260dae..942b394 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/BinaryData.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/BinaryData.as
@@ -1110,7 +1110,11 @@ public class BinaryData implements IBinaryDataInput, IBinaryDataOutput
if (prependLength) {
var temp:Uint8Array = new Uint8Array(bytes.length + 2);
temp.set(bytes , 2);
- new Uint16Array(temp.buffer,0,2)[0] = bytes.length;
+ var len:uint = bytes.length;
+ //preconvert to alternate endian if needed
+ new Uint16Array(temp.buffer,0,2)[0] =
+ (_endian == Endian.defaultEndian) ?
+ len : ((len & 0xff) >> 8) | (len << 8);
bytes = temp;
}
return bytes;