GitHub user greg-dove opened a pull request:
https://github.com/apache/flex-asjs/pull/10
Binary data improvement
As discussed with Harbs, this is my effort to get BinaryData closer to the
regular flash ByteArray, particularly in terms of getting close to the
IDataInput and IDataOutput flash interfaces, and fixing a few bugs that were
only discovered through variations in use from testing. I have left out the amf
write/read stuff and the multibyte text, but I think the rest is there now.
There is at least one breaking change against the previous behavior :
readByte() is now a signed byte, readUnsignedByte() is needed whereever that
was being used.
I've added unit tests, which only run against the swf build, but I have
manually tested and verified these all against the js output as well, across
Chrome, Edge 13, IE11, Firefox.
Comments:
I think the data getter could be removed from BinaryData as on swf the
array getter now provides the same thing and on js the underlying ArrayBuffer
is also accessible on the Uint8Array from the array getter.
I added endianness detection to Endian with defaultEndian static getter.
This should always resolve to one of the two types but I left an unresolved
'unknownEndian' state if something does not work here. This might be useful in
terms of letting a server know what byte order the client prefers etc.
L
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/greg-dove/flex-asjs BinaryData_improvement
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flex-asjs/pull/10.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #10
----
commit 641301b0c5a070ebf65b69cbf0a1dee9dcdb6b72
Author: greg-dove <[email protected]>
Date: 2016-07-22T08:01:38Z
[Improvement] Numerous updates to BinaryData to get closer to flash
IDataInput and IDataOutput interfaces.
Endian now detects default Endianness. IBinaryDataInput and
IBinaryDataOutput interfaces added
commit 8a9b91b4bb3e8d56590546455704631de16bcdac
Author: greg-dove <[email protected]>
Date: 2016-07-22T08:03:03Z
[Test] Added swf-side unit tests for BinaryData changes (these also
currently pass when mocked in the browser for the js version)
commit 3efcd71991b1383107e5c9ae3e0566941aa26dcd
Author: greg-dove <[email protected]>
Date: 2016-07-22T08:05:10Z
Merge branch 'develop' into improvement_Binarydata
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---