Comments (5)
@mhsjlw Could you please describe why ByteOrder::write_uint
and ByteOrder::read_uint
are insufficient?
from byteorder.
Not only would an in-library implementation be easier to understand (for someone reading your code) but it would also make it much easier when you need to write little or big endian triads rather than writing your own implementation in-house. If it is just me who wants i24s, I understand that there is no demand and I'll probably just add it myself. Although I think it'd be a useful feature to have.
from byteorder.
rather than writing your own implementation in-house
I don't understand. You don't need to do this. read_uint(buf, 3)
seems like it should be sufficient, no?
from byteorder.
Oh wow... I was unaware it was this simple. Thank you very much. How could I make this little endian as well?
from byteorder.
@mhsjlw The examples should help. :-) If you're reading from an io::Read
, then use rdr.read_uint::<LittleEndian>(3)
. If you're reading straight from a buffer, then LittleEndian::read_uint(buf, 3)
.
from byteorder.
Related Issues (20)
- Support async analogues of Read and Write extensions HOT 2
- Add `read_u40` HOT 1
- Using byteorder with type definitions HOT 1
- upgrade quickcheck to 1.0
- panic in try from slice HOT 4
- Changelog is not up to date
- Document MSRV HOT 1
- Rust is failing to find type definitions or enumerations HOT 2
- Consider supporting outdated Rust versions to make bincode happy HOT 1
- Add impl of `ReadBytesExt` and `WriteBytesExt` for `core2::io::Write` HOT 7
- Implement `read_usize` HOT 5
- Transparently support reading into arrays of types that are byte-compatible with integers HOT 1
- Endianness-managing Read/Write wrapper? HOT 2
- add ReadFrom and WriteTo traits with a derive macro HOT 1
- Any difference to Rust official functions? HOT 1
- Unsound assumption about the alignment of u32 and f32
- write_i64 does not write to the buffer HOT 2
- [Bug] Some unknown error caused by byteorder 1.5.0 HOT 1
- Expose `#[forbid(unsafe_code)]` subset HOT 3
- write_int never panics on out of range input
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from byteorder.