tag | 26e7c05992fc0dafab035cd77dd94e11d7a30d01 | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Thu Jan 04 16:56:07 2024 -0800 |
object | 0bae1e9c34d916e2cb250cbcb85d8e9fd62472a6 |
frc_340819010 (10586669,com.google.android.adbd,com.google.android.adservices,com.google.android.appsearch,com.google.android.captiveportallogin,com.google.android.configinfrastructure,com.google.android.conscrypt,com.google.android.documentsui,com.google.android.ext.services,com.google.android.extservices,com.google.android.go.adbd,com.google.android.go.adservices,com.google.android.go.appsearch,com.google.android.go.captiveportallogin,com.google.android.go.configinfrastructure,com.google.android.go.conscrypt,com.google.android.go.documentsui,com.google.android.go.extservices,com.google.android.go.ipsec,com.google.android.go.mediaprovider,com.google.android.go.networkstack,com.google.android.go.neuralnetworks,com.google.android.go.ondevicepersonalization,com.google.android.go.os.statsd,com.google.android.go.resolv,com.google.android.go.rkpd,com.google.android.go.scheduling,com.google.android.go.sdkext,com.google.android.go.tethering,com.google.android.go.tzdata5,com.google.android.go.uwb,com.google.android.go.wifi,com.google.android.ipsec,com.google.android.networkstack,com.google.android.neuralnetworks,com.google.android.ondevicepersonalization,com.google.android.os.statsd,com.google.android.resolv,com.google.android.rkpd,com.google.android.scheduling,com.google.android.sdkext,com.google.android.tethering,com.google.android.tzdata5,com.google.android.uwb,com.google.android.wifi)
commit | 0bae1e9c34d916e2cb250cbcb85d8e9fd62472a6 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Tue Apr 11 17:57:41 2023 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Tue Apr 11 17:57:41 2023 +0000 |
tree | 2e4fcf8cb0393566c83c3292c845b3b95c86afac | |
parent | d89a886278df0f1a161fb23bf0221cd8ab118ea7 [diff] | |
parent | d934fe9c466a12d848a21ea394040f204d786edd [diff] |
Snap for 9912757 from d934fe9c466a12d848a21ea394040f204d786edd to aml-frc-release Change-Id: I74e749b5db84afefe9c9cfcb52af74be4945409b
This crate provides convenience methods for encoding and decoding numbers in either big-endian or little-endian order.
Dual-licensed under MIT or the UNLICENSE.
This crate works with Cargo and is on crates.io. Add it to your Cargo.toml
like so:
[dependencies] byteorder = "1"
If you want to augment existing Read
and Write
traits, then import the extension methods like so:
use byteorder::{ReadBytesExt, WriteBytesExt, BigEndian, LittleEndian};
For example:
use std::io::Cursor; use byteorder::{BigEndian, ReadBytesExt}; let mut rdr = Cursor::new(vec![2, 5, 3, 0]); // Note that we use type parameters to indicate which kind of byte order // we want! assert_eq!(517, rdr.read_u16::<BigEndian>().unwrap()); assert_eq!(768, rdr.read_u16::<BigEndian>().unwrap());
no_std
cratesThis crate has a feature, std
, that is enabled by default. To use this crate in a no_std
context, add the following to your Cargo.toml
:
[dependencies] byteorder = { version = "1", default-features = false }
Note that as of Rust 1.32, the standard numeric types provide built-in methods like to_le_bytes
and from_le_bytes
, which support some of the same use cases.