5.3.0#13
Merged
Merged
Conversation
- **New Feature**: Added random access read methods — `getUint8(int position)`, `getInt16(int position)`, `getUint16(int position)`, `getInt32(int position)`, `getUint32(int position)`, `getInt64(int position)`, `getUint64(int position)`, `getFloat32(int position)`, `getFloat64(int position)` — read at arbitrary position without advancing offset. - **Refactoring**: Rewritten using `extension type` for zero-cost abstractions. - **Refactoring**: Methods organized into semantic extension groups (`BinaryReaderCore`, `BinaryReaderVarInt`, `BinaryReaderNumeric`, `BinaryReaderBytesString`, `BinaryReaderRandomAccess`, `BinaryReaderPosition`, `BinaryReaderInternal`). - **BinaryWriter**: - **New Feature**: Added random access read methods — `getUint8(int position)`, `getInt16(int position)`, `getUint16(int position)`, `getInt32(int position)`, `getUint32(int position)`, `getInt64(int position)`, `getUint64(int position)`, `getFloat32(int position)`, `getFloat64(int position)` — read written bytes at arbitrary position. - **New Feature**: Added random access write methods — `setUint8(int position, int value)`, `setInt16(int position, int value)`, `setUint16(int position, int value)`, `setInt32(int position, int value)`, `setUint32(int position, int value)`, `setInt64(int position, int value)`, `setUint64(int position, int value)`, `setFloat32(int position, double value)`, `setFloat64(int position, double value)` — write at arbitrary position without changing offset. - **Refactoring**: Rewritten using `extension type` for zero-cost abstractions. - **Refactoring**: Methods organized into semantic extension groups (`BinaryWriterCore`, `BinaryWriterVarInt`, `BinaryWriterNumeric`, `BinaryWriterBytesString`, `BinaryWriterRandomAccess`, `BinaryWriterPosition`, `BinaryWriterInternal`). - **Tests**: - Added `test/unit/binary_reader_get_test.dart` — 41 tests for random access reads. - Added `test/unit/binary_writer_set_get_test.dart` — 49 tests for random access reads/writes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
5.3.0
BinaryReader:
getUint8(int position),getInt16(int position),getUint16(int position),getInt32(int position),getUint32(int position),getInt64(int position),getUint64(int position),getFloat32(int position),getFloat64(int position)— read at arbitrary position without advancing offset.extension typefor zero-cost abstractions.BinaryReaderCore,BinaryReaderVarInt,BinaryReaderNumeric,BinaryReaderBytesString,BinaryReaderRandomAccess,BinaryReaderPosition,BinaryReaderInternal).BinaryWriter:
getUint8(int position),getInt16(int position),getUint16(int position),getInt32(int position),getUint32(int position),getInt64(int position),getUint64(int position),getFloat32(int position),getFloat64(int position)— read written bytes at arbitrary position.setUint8(int position, int value),setInt16(int position, int value),setUint16(int position, int value),setInt32(int position, int value),setUint32(int position, int value),setInt64(int position, int value),setUint64(int position, int value),setFloat32(int position, double value),setFloat64(int position, double value)— write at arbitrary position without changing offset.extension typefor zero-cost abstractions.BinaryWriterCore,BinaryWriterVarInt,BinaryWriterNumeric,BinaryWriterBytesString,BinaryWriterRandomAccess,BinaryWriterPosition,BinaryWriterInternal).Tests:
test/unit/binary_reader_get_test.dart— 41 tests for random access reads.test/unit/binary_writer_set_get_test.dart— 49 tests for random access reads/writes.