flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject [04/15] git commit: [flex-asjs] [refs/heads/refactor-sprite] - Fix for UTC prepended short - respect endianness
Date Thu, 04 Aug 2016 05:29:33 GMT
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/refactor-sprite
Commit: d12bcddf444da559931b351fd4d93d7648e1758f
Parents: 3efcd71
Author: greg-dove <greg.dove@gmail.com>
Authored: Sat Jul 23 16:23:49 2016 +1200
Committer: greg-dove <greg.dove@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;


Mime
View raw message