flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From greg-dove <...@git.apache.org>
Subject [GitHub] flex-asjs issue #10: Binary data improvement
Date Fri, 22 Jul 2016 18:03:37 GMT
Github user greg-dove commented on the issue:

    I just read back on the other comments, some of which I had missed seeing
    before my earlier reply. If defaulting to big endian is necessary on js for
    consistency, that's easy simply by changing the initialize value in
    BinaryData and everything else still works as described above (explicitly
    setting to LITTLE_ENDIAN later will still use optimized code on js).
    On Sat, Jul 23, 2016 at 5:37 AM, asfbot <notifications@github.com> wrote:
    > Greg Dove on dev@flex.apache.org replies:
    > Harbs,
    > FYI the changes I made do not alter the behavior that was there originally,
    > but they do provide the user with more information, and also retain the
    > optimal code path after a BinaryData has had an explicit endian value set.
    > Flash continues to default to BIG_ENDIAN as before. I don't actually know
    > if the native flash bytearray is faster in the same mode as the hardware or
    > not... perhaps that is something to check.
    > So now (in javascript only, not flash) it will pretty much show
    > new BinaryData().endian == Endian.LITTLE_ENDIAN
    > and
    > you can still check whether the BinaryData is in the optimized mode via
    > new BinaryData().endian == Endian.defaultEndian;
    > but you can also check (independent of BinaryData, for example) if the
    > system optimized endianness is little endian or big endian:
    > Endian.defaultEndian == Endian.LITTLE_ENDIAN
    > Because the default setting on BinaryData is now a known optimized default,
    > instead of "DEFAULT", the optimized branch of the read/write method inside
    > the javascript code is still used when it matches the faster option after
    > explicitly setting the endianness.
    > Before if you did:
    > var bd:BinaryData=new BinaryData();
    > bd.endian = Endian.LITTLE_ENDIAN;
    > if would no longer have the 'DEFAULT' value and would take the 'DataView'
    > path in the code. Now it will still use the faster fixed typearray options
    > in the read/write methods.
    > Actually I had another (unrelated) thought
    > I think the writeByteAt and readByteAt methods could be renamed to
    > getByteAt and setByteAt. Although it can be made clear in the docs that
    > they do not alter the internal position point, this change would make them
    > quite distinct from all the other read/write methods and (I think) closer
    > semantically to the underlying array access implementation. Just an idea...
    > Also what do you think about removing the data getter?
    > cheers,
    > Greg
    > —
    > You are receiving this because you authored the thread.
    > Reply to this email directly, view it on GitHub
    > <https://github.com/apache/flex-asjs/pull/10#issuecomment-234607422>, or mute
    > the thread
    > <https://github.com/notifications/unsubscribe-auth/AEW31qn76CubCGSUpTa6bleBRdX9m6fEks5qYP_3gaJpZM4JSjUh>
    > .

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 infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message