Struct bytebuffer::ByteBuffer
source · [−]pub struct ByteBuffer { /* private fields */ }
Expand description
A byte buffer object specifically turned to easily read and write binary values
Implementations
sourceimpl ByteBuffer
impl ByteBuffer
sourcepub fn new() -> ByteBufferⓘNotable traits for ByteBufferimpl Read for ByteBufferimpl Write for ByteBuffer
pub fn new() -> ByteBufferⓘNotable traits for ByteBufferimpl Read for ByteBufferimpl Write for ByteBuffer
Construct a new, empty, ByteBuffer
sourcepub fn from_bytes(bytes: &[u8]) -> ByteBufferⓘNotable traits for ByteBufferimpl Read for ByteBufferimpl Write for ByteBuffer
pub fn from_bytes(bytes: &[u8]) -> ByteBufferⓘNotable traits for ByteBufferimpl Read for ByteBufferimpl Write for ByteBuffer
Construct a new ByteBuffer filled with the data array.
sourcepub fn from_vec(vec: Vec<u8>) -> ByteBufferⓘNotable traits for ByteBufferimpl Read for ByteBufferimpl Write for ByteBuffer
pub fn from_vec(vec: Vec<u8>) -> ByteBufferⓘNotable traits for ByteBufferimpl Read for ByteBufferimpl Write for ByteBuffer
Constructs a new ByteBuffer from an existing vector. This function takes ownership of the vector
pub fn is_empty(&self) -> bool
sourcepub fn resize(&mut self, size: usize)
pub fn resize(&mut self, size: usize)
Change the buffer size to size.
Note: You cannot shrink a buffer with this method
sourcepub fn set_endian(&mut self, endian: Endian)
pub fn set_endian(&mut self, endian: Endian)
Set the byte order of the buffer
Note: By default the buffer uses big endian order
sourcepub fn write_bytes(&mut self, bytes: &[u8])
pub fn write_bytes(&mut self, bytes: &[u8])
Append a byte array to the buffer. The buffer is automatically extended if needed Note: This method resets the read and write cursor for bitwise reading.
#Example
let mut buffer = ByteBuffer::new();
buffer.write_bytes(&vec![0x1, 0xFF, 0x45]); // buffer contains [0x1, 0xFF, 0x45]
sourcepub fn write_u8(&mut self, val: u8)
pub fn write_u8(&mut self, val: u8)
Append a byte (8 bits value) to the buffer Note: This method resets the read and write cursor for bitwise reading.
#Example
let mut buffer = ByteBuffer::new();
buffer.write_u8(1) // buffer contains [0x1]
sourcepub fn write_i8(&mut self, val: i8)
pub fn write_i8(&mut self, val: i8)
Same as write_u8()
but for signed values
Note: This method resets the read and write cursor for bitwise reading.
sourcepub fn write_u16(&mut self, val: u16)
pub fn write_u16(&mut self, val: u16)
Append a word (16 bits value) to the buffer Note: This method resets the read and write cursor for bitwise reading.
#Example
let mut buffer = ByteBuffer::new();
buffer.write_u16(1) // buffer contains [0x00, 0x1] if little endian
sourcepub fn write_i16(&mut self, val: i16)
pub fn write_i16(&mut self, val: i16)
Same as write_u16()
but for signed values
Note: This method resets the read and write cursor for bitwise reading.
sourcepub fn write_u32(&mut self, val: u32)
pub fn write_u32(&mut self, val: u32)
Append a double word (32 bits value) to the buffer Note: This method resets the read and write cursor for bitwise reading.
#Example
let mut buffer = ByteBuffer::new();
buffer.write_u32(1) // buffer contains [0x00, 0x00, 0x00, 0x1] if little endian
sourcepub fn write_i32(&mut self, val: i32)
pub fn write_i32(&mut self, val: i32)
Same as write_u32()
but for signed values
Note: This method resets the read and write cursor for bitwise reading.
sourcepub fn write_u64(&mut self, val: u64)
pub fn write_u64(&mut self, val: u64)
Append a quaddruple word (64 bits value) to the buffer Note: This method resets the read and write cursor for bitwise reading.
#Example
let mut buffer = ByteBuffer::new();
buffer.write_u64(1) // buffer contains [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1] if little endian
sourcepub fn write_i64(&mut self, val: i64)
pub fn write_i64(&mut self, val: i64)
Same as write_u64()
but for signed values
Note: This method resets the read and write cursor for bitwise reading.
sourcepub fn write_f32(&mut self, val: f32)
pub fn write_f32(&mut self, val: f32)
Append a 32 bits floating point number to the buffer. Note: This method resets the read and write cursor for bitwise reading.
#Example
let mut buffer = ByteBuffer::new();
buffer.write_f32(0.1)
sourcepub fn write_f64(&mut self, val: f64)
pub fn write_f64(&mut self, val: f64)
Append a 64 bits floating point number to the buffer. Note: This method resets the read and write cursor for bitwise reading.
#Example
let mut buffer = ByteBuffer::new();
buffer.write_f64(0.1)
sourcepub fn write_string(&mut self, val: &str)
pub fn write_string(&mut self, val: &str)
Append a string to the buffer. Note: This method resets the read and write cursor for bitwise reading.
Format The format is (u32)size + size * (u8)characters
#Example
let mut buffer = ByteBuffer::new();
buffer.write_string("Hello")
sourcepub fn read_bytes(&mut self, size: usize) -> Result<Vec<u8>>
pub fn read_bytes(&mut self, size: usize) -> Result<Vec<u8>>
Read a defined amount of raw bytes, or return an IO error if not enough bytes are available. Note: This method resets the read and write cursor for bitwise reading.
sourcepub fn read_u8(&mut self) -> Result<u8>
pub fn read_u8(&mut self) -> Result<u8>
Read one byte, or return an IO error if not enough bytes are available. Note: This method resets the read and write cursor for bitwise reading.
#Example
let mut buffer = ByteBuffer::from_bytes(&vec![0x1]);
let value = buffer.read_u8().unwrap(); //Value contains 1
sourcepub fn read_u16(&mut self) -> Result<u16>
pub fn read_u16(&mut self) -> Result<u16>
Read a 2-bytes long value, or return an IO error if not enough bytes are available. Note: This method resets the read and write cursor for bitwise reading.
#Example
let mut buffer = ByteBuffer::from_bytes(&vec![0x0, 0x1]);
let value = buffer.read_u16().unwrap(); //Value contains 1
sourcepub fn read_i16(&mut self) -> Result<i16>
pub fn read_i16(&mut self) -> Result<i16>
Same as read_u16()
but for signed values
Note: This method resets the read and write cursor for bitwise reading.
sourcepub fn read_u32(&mut self) -> Result<u32>
pub fn read_u32(&mut self) -> Result<u32>
Read a four-bytes long value, or return an IO error if not enough bytes are available. Note: This method resets the read and write cursor for bitwise reading.
#Example
let mut buffer = ByteBuffer::from_bytes(&vec![0x0, 0x0, 0x0, 0x1]);
let value = buffer.read_u32().unwrap(); // Value contains 1
sourcepub fn read_i32(&mut self) -> Result<i32>
pub fn read_i32(&mut self) -> Result<i32>
Same as read_u32()
but for signed values
Note: This method resets the read and write cursor for bitwise reading.
sourcepub fn read_u64(&mut self) -> Result<u64>
pub fn read_u64(&mut self) -> Result<u64>
Read an eight bytes long value, or return an IO error if not enough bytes are available. Note: This method resets the read and write cursor for bitwise reading.
#Example
let mut buffer = ByteBuffer::from_bytes(&vec![0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1]);
let value = buffer.read_u64().unwrap(); //Value contains 1
sourcepub fn read_i64(&mut self) -> Result<i64>
pub fn read_i64(&mut self) -> Result<i64>
Same as read_u64()
but for signed values
Note: This method resets the read and write cursor for bitwise reading.
sourcepub fn read_f32(&mut self) -> Result<f32>
pub fn read_f32(&mut self) -> Result<f32>
Read a 32 bits floating point value, or return an IO error if not enough bytes are available. Note: This method resets the read and write cursor for bitwise reading.
sourcepub fn read_f64(&mut self) -> Result<f64>
pub fn read_f64(&mut self) -> Result<f64>
Read a 64 bits floating point value, or return an IO error if not enough bytes are available. Note: This method resets the read and write cursor for bitwise reading.
sourcepub fn read_string(&mut self) -> Result<String>
pub fn read_string(&mut self) -> Result<String>
Read a string.
Note: First it reads a 32 bits value representing the size, then ‘size’ raw bytes that must be encoded as UTF8. Note: This method resets the read and write cursor for bitwise reading.
sourcepub fn to_hex_dump(&self) -> String
pub fn to_hex_dump(&self) -> String
Dump the byte buffer to a string.
sourcepub fn set_rpos(&mut self, rpos: usize)
pub fn set_rpos(&mut self, rpos: usize)
Set the reading cursor position.
Note: Sets the reading cursor to min(newPosition, self.len())
to prevent overflow
sourcepub fn set_wpos(&mut self, wpos: usize)
pub fn set_wpos(&mut self, wpos: usize)
Set the writing cursor position.
Note: Sets the writing cursor to min(newPosition, self.len())
to prevent overflow
sourcepub fn read_bit(&mut self) -> Result<bool>
pub fn read_bit(&mut self) -> Result<bool>
Read 1 bit. Return true if the bit is set to 1, otherwhise, return false.
Note: Bits are read from left to right
#Example
let mut buffer = ByteBuffer::from_bytes(&vec![128]); // 10000000b
let value1 = buffer.read_bit().unwrap(); //value1 contains true (eg: bit is 1)
let value2 = buffer.read_bit().unwrap(); //value2 contains false (eg: bit is 0)
sourcepub fn read_bits(&mut self, n: u8) -> Result<u64>
pub fn read_bits(&mut self, n: u8) -> Result<u64>
Read n bits. an return the corresponding value an u64.
Note: We cannot read more than 64 bits
Note: Bits are read from left to right
#Example
let mut buffer = ByteBuffer::from_bytes(&vec![128]); // 10000000b
let value = buffer.read_bits(3).unwrap(); // value contains 4 (eg: 100b)
sourcepub fn flush_bit(&mut self)
pub fn flush_bit(&mut self)
Discard all the pending bits available for reading or writing and place the corresponding cursor to the next byte.
Note: If no bits are currently read or written, this function does nothing.
#Example
10010010 | 00000001
^
10010010 | 00000001 // read_bit called
^
10010010 | 00000001 // flush_bit() called
^
sourcepub fn write_bit(&mut self, bit: bool)
pub fn write_bit(&mut self, bit: bool)
Append 1 bit value to the buffer. The bit is appended like this :
...| XXXXXXXX | 10000000 |....
sourcepub fn write_bits(&mut self, value: u64, n: u8)
pub fn write_bits(&mut self, value: u64, n: u8)
Write the given value as a sequence of n bits
#Example
let mut buffer = ByteBuffer::new();
buffer.write_bits(4, 3); // append 100b
Trait Implementations
sourceimpl Debug for ByteBuffer
impl Debug for ByteBuffer
sourceimpl Default for ByteBuffer
impl Default for ByteBuffer
sourceimpl Read for ByteBuffer
impl Read for ByteBuffer
sourcefn read(&mut self, buf: &mut [u8]) -> Result<usize>
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more
1.36.0 · sourcefn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
Like read
, except that it reads into a slice of buffers. Read more
sourcefn is_read_vectored(&self) -> bool
fn is_read_vectored(&self) -> bool
can_vector
)Determines if this Read
er has an efficient read_vectored
implementation. Read more
1.0.0 · sourcefn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
fn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
Read all bytes until EOF in this source, placing them into buf
. Read more
1.0.0 · sourcefn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
Read all bytes until EOF in this source, appending them to buf
. Read more
1.6.0 · sourcefn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
Read the exact number of bytes required to fill buf
. Read more
sourcefn read_buf(&mut self, buf: &mut ReadBuf<'_>) -> Result<(), Error>
fn read_buf(&mut self, buf: &mut ReadBuf<'_>) -> Result<(), Error>
read_buf
)Pull some bytes from this source into the specified buffer. Read more
sourcefn read_buf_exact(&mut self, buf: &mut ReadBuf<'_>) -> Result<(), Error>
fn read_buf_exact(&mut self, buf: &mut ReadBuf<'_>) -> Result<(), Error>
read_buf
)Read the exact number of bytes required to fill buf
. Read more
1.0.0 · sourcefn by_ref(&mut self) -> &mut Self
fn by_ref(&mut self) -> &mut Self
Creates a “by reference” adaptor for this instance of Read
. Read more
sourceimpl Write for ByteBuffer
impl Write for ByteBuffer
sourcefn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Write a buffer into this writer, returning how many bytes were written. Read more
sourcefn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
sourcefn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector
)Determines if this Write
r has an efficient write_vectored
implementation. Read more
1.0.0 · sourcefn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
sourcefn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
Auto Trait Implementations
impl RefUnwindSafe for ByteBuffer
impl Send for ByteBuffer
impl Sync for ByteBuffer
impl Unpin for ByteBuffer
impl UnwindSafe for ByteBuffer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<R> ReadBytesExt for R where
R: Read + ?Sized,
impl<R> ReadBytesExt for R where
R: Read + ?Sized,
sourcefn read_u8(&mut self) -> Result<u8, Error>
fn read_u8(&mut self) -> Result<u8, Error>
Reads an unsigned 8 bit integer from the underlying reader. Read more
sourcefn read_i8(&mut self) -> Result<i8, Error>
fn read_i8(&mut self) -> Result<i8, Error>
Reads a signed 8 bit integer from the underlying reader. Read more
sourcefn read_u16<T>(&mut self) -> Result<u16, Error> where
T: ByteOrder,
fn read_u16<T>(&mut self) -> Result<u16, Error> where
T: ByteOrder,
Reads an unsigned 16 bit integer from the underlying reader. Read more
sourcefn read_i16<T>(&mut self) -> Result<i16, Error> where
T: ByteOrder,
fn read_i16<T>(&mut self) -> Result<i16, Error> where
T: ByteOrder,
Reads a signed 16 bit integer from the underlying reader. Read more
sourcefn read_u24<T>(&mut self) -> Result<u32, Error> where
T: ByteOrder,
fn read_u24<T>(&mut self) -> Result<u32, Error> where
T: ByteOrder,
Reads an unsigned 24 bit integer from the underlying reader. Read more
sourcefn read_i24<T>(&mut self) -> Result<i32, Error> where
T: ByteOrder,
fn read_i24<T>(&mut self) -> Result<i32, Error> where
T: ByteOrder,
Reads a signed 24 bit integer from the underlying reader. Read more
sourcefn read_u32<T>(&mut self) -> Result<u32, Error> where
T: ByteOrder,
fn read_u32<T>(&mut self) -> Result<u32, Error> where
T: ByteOrder,
Reads an unsigned 32 bit integer from the underlying reader. Read more
sourcefn read_i32<T>(&mut self) -> Result<i32, Error> where
T: ByteOrder,
fn read_i32<T>(&mut self) -> Result<i32, Error> where
T: ByteOrder,
Reads a signed 32 bit integer from the underlying reader. Read more
sourcefn read_u48<T>(&mut self) -> Result<u64, Error> where
T: ByteOrder,
fn read_u48<T>(&mut self) -> Result<u64, Error> where
T: ByteOrder,
Reads an unsigned 48 bit integer from the underlying reader. Read more
sourcefn read_i48<T>(&mut self) -> Result<i64, Error> where
T: ByteOrder,
fn read_i48<T>(&mut self) -> Result<i64, Error> where
T: ByteOrder,
Reads a signed 48 bit integer from the underlying reader. Read more
sourcefn read_u64<T>(&mut self) -> Result<u64, Error> where
T: ByteOrder,
fn read_u64<T>(&mut self) -> Result<u64, Error> where
T: ByteOrder,
Reads an unsigned 64 bit integer from the underlying reader. Read more
sourcefn read_i64<T>(&mut self) -> Result<i64, Error> where
T: ByteOrder,
fn read_i64<T>(&mut self) -> Result<i64, Error> where
T: ByteOrder,
Reads a signed 64 bit integer from the underlying reader. Read more
sourcefn read_u128<T>(&mut self) -> Result<u128, Error> where
T: ByteOrder,
fn read_u128<T>(&mut self) -> Result<u128, Error> where
T: ByteOrder,
Reads an unsigned 128 bit integer from the underlying reader. Read more
sourcefn read_i128<T>(&mut self) -> Result<i128, Error> where
T: ByteOrder,
fn read_i128<T>(&mut self) -> Result<i128, Error> where
T: ByteOrder,
Reads a signed 128 bit integer from the underlying reader. Read more
sourcefn read_uint<T>(&mut self, nbytes: usize) -> Result<u64, Error> where
T: ByteOrder,
fn read_uint<T>(&mut self, nbytes: usize) -> Result<u64, Error> where
T: ByteOrder,
Reads an unsigned n-bytes integer from the underlying reader. Read more
sourcefn read_int<T>(&mut self, nbytes: usize) -> Result<i64, Error> where
T: ByteOrder,
fn read_int<T>(&mut self, nbytes: usize) -> Result<i64, Error> where
T: ByteOrder,
Reads a signed n-bytes integer from the underlying reader. Read more
sourcefn read_uint128<T>(&mut self, nbytes: usize) -> Result<u128, Error> where
T: ByteOrder,
fn read_uint128<T>(&mut self, nbytes: usize) -> Result<u128, Error> where
T: ByteOrder,
Reads an unsigned n-bytes integer from the underlying reader.
sourcefn read_int128<T>(&mut self, nbytes: usize) -> Result<i128, Error> where
T: ByteOrder,
fn read_int128<T>(&mut self, nbytes: usize) -> Result<i128, Error> where
T: ByteOrder,
Reads a signed n-bytes integer from the underlying reader.
sourcefn read_f32<T>(&mut self) -> Result<f32, Error> where
T: ByteOrder,
fn read_f32<T>(&mut self) -> Result<f32, Error> where
T: ByteOrder,
Reads a IEEE754 single-precision (4 bytes) floating point number from the underlying reader. Read more
sourcefn read_f64<T>(&mut self) -> Result<f64, Error> where
T: ByteOrder,
fn read_f64<T>(&mut self) -> Result<f64, Error> where
T: ByteOrder,
Reads a IEEE754 double-precision (8 bytes) floating point number from the underlying reader. Read more
sourcefn read_u16_into<T>(&mut self, dst: &mut [u16]) -> Result<(), Error> where
T: ByteOrder,
fn read_u16_into<T>(&mut self, dst: &mut [u16]) -> Result<(), Error> where
T: ByteOrder,
Reads a sequence of unsigned 16 bit integers from the underlying reader. Read more
sourcefn read_u32_into<T>(&mut self, dst: &mut [u32]) -> Result<(), Error> where
T: ByteOrder,
fn read_u32_into<T>(&mut self, dst: &mut [u32]) -> Result<(), Error> where
T: ByteOrder,
Reads a sequence of unsigned 32 bit integers from the underlying reader. Read more
sourcefn read_u64_into<T>(&mut self, dst: &mut [u64]) -> Result<(), Error> where
T: ByteOrder,
fn read_u64_into<T>(&mut self, dst: &mut [u64]) -> Result<(), Error> where
T: ByteOrder,
Reads a sequence of unsigned 64 bit integers from the underlying reader. Read more
sourcefn read_u128_into<T>(&mut self, dst: &mut [u128]) -> Result<(), Error> where
T: ByteOrder,
fn read_u128_into<T>(&mut self, dst: &mut [u128]) -> Result<(), Error> where
T: ByteOrder,
Reads a sequence of unsigned 128 bit integers from the underlying reader. Read more
sourcefn read_i8_into(&mut self, dst: &mut [i8]) -> Result<(), Error>
fn read_i8_into(&mut self, dst: &mut [i8]) -> Result<(), Error>
Reads a sequence of signed 8 bit integers from the underlying reader. Read more
sourcefn read_i16_into<T>(&mut self, dst: &mut [i16]) -> Result<(), Error> where
T: ByteOrder,
fn read_i16_into<T>(&mut self, dst: &mut [i16]) -> Result<(), Error> where
T: ByteOrder,
Reads a sequence of signed 16 bit integers from the underlying reader. Read more
sourcefn read_i32_into<T>(&mut self, dst: &mut [i32]) -> Result<(), Error> where
T: ByteOrder,
fn read_i32_into<T>(&mut self, dst: &mut [i32]) -> Result<(), Error> where
T: ByteOrder,
Reads a sequence of signed 32 bit integers from the underlying reader. Read more
sourcefn read_i64_into<T>(&mut self, dst: &mut [i64]) -> Result<(), Error> where
T: ByteOrder,
fn read_i64_into<T>(&mut self, dst: &mut [i64]) -> Result<(), Error> where
T: ByteOrder,
Reads a sequence of signed 64 bit integers from the underlying reader. Read more
sourcefn read_i128_into<T>(&mut self, dst: &mut [i128]) -> Result<(), Error> where
T: ByteOrder,
fn read_i128_into<T>(&mut self, dst: &mut [i128]) -> Result<(), Error> where
T: ByteOrder,
Reads a sequence of signed 128 bit integers from the underlying reader. Read more
sourcefn read_f32_into<T>(&mut self, dst: &mut [f32]) -> Result<(), Error> where
T: ByteOrder,
fn read_f32_into<T>(&mut self, dst: &mut [f32]) -> Result<(), Error> where
T: ByteOrder,
Reads a sequence of IEEE754 single-precision (4 bytes) floating point numbers from the underlying reader. Read more
sourcefn read_f32_into_unchecked<T>(&mut self, dst: &mut [f32]) -> Result<(), Error> where
T: ByteOrder,
fn read_f32_into_unchecked<T>(&mut self, dst: &mut [f32]) -> Result<(), Error> where
T: ByteOrder,
please use read_f32_into
instead
DEPRECATED. Read more
sourceimpl<W> WriteBytesExt for W where
W: Write + ?Sized,
impl<W> WriteBytesExt for W where
W: Write + ?Sized,
sourcefn write_u8(&mut self, n: u8) -> Result<(), Error>
fn write_u8(&mut self, n: u8) -> Result<(), Error>
Writes an unsigned 8 bit integer to the underlying writer. Read more
sourcefn write_i8(&mut self, n: i8) -> Result<(), Error>
fn write_i8(&mut self, n: i8) -> Result<(), Error>
Writes a signed 8 bit integer to the underlying writer. Read more
sourcefn write_u16<T>(&mut self, n: u16) -> Result<(), Error> where
T: ByteOrder,
fn write_u16<T>(&mut self, n: u16) -> Result<(), Error> where
T: ByteOrder,
Writes an unsigned 16 bit integer to the underlying writer. Read more
sourcefn write_i16<T>(&mut self, n: i16) -> Result<(), Error> where
T: ByteOrder,
fn write_i16<T>(&mut self, n: i16) -> Result<(), Error> where
T: ByteOrder,
Writes a signed 16 bit integer to the underlying writer. Read more
sourcefn write_u24<T>(&mut self, n: u32) -> Result<(), Error> where
T: ByteOrder,
fn write_u24<T>(&mut self, n: u32) -> Result<(), Error> where
T: ByteOrder,
Writes an unsigned 24 bit integer to the underlying writer. Read more
sourcefn write_i24<T>(&mut self, n: i32) -> Result<(), Error> where
T: ByteOrder,
fn write_i24<T>(&mut self, n: i32) -> Result<(), Error> where
T: ByteOrder,
Writes a signed 24 bit integer to the underlying writer. Read more
sourcefn write_u32<T>(&mut self, n: u32) -> Result<(), Error> where
T: ByteOrder,
fn write_u32<T>(&mut self, n: u32) -> Result<(), Error> where
T: ByteOrder,
Writes an unsigned 32 bit integer to the underlying writer. Read more
sourcefn write_i32<T>(&mut self, n: i32) -> Result<(), Error> where
T: ByteOrder,
fn write_i32<T>(&mut self, n: i32) -> Result<(), Error> where
T: ByteOrder,
Writes a signed 32 bit integer to the underlying writer. Read more
sourcefn write_u48<T>(&mut self, n: u64) -> Result<(), Error> where
T: ByteOrder,
fn write_u48<T>(&mut self, n: u64) -> Result<(), Error> where
T: ByteOrder,
Writes an unsigned 48 bit integer to the underlying writer. Read more
sourcefn write_i48<T>(&mut self, n: i64) -> Result<(), Error> where
T: ByteOrder,
fn write_i48<T>(&mut self, n: i64) -> Result<(), Error> where
T: ByteOrder,
Writes a signed 48 bit integer to the underlying writer. Read more
sourcefn write_u64<T>(&mut self, n: u64) -> Result<(), Error> where
T: ByteOrder,
fn write_u64<T>(&mut self, n: u64) -> Result<(), Error> where
T: ByteOrder,
Writes an unsigned 64 bit integer to the underlying writer. Read more
sourcefn write_i64<T>(&mut self, n: i64) -> Result<(), Error> where
T: ByteOrder,
fn write_i64<T>(&mut self, n: i64) -> Result<(), Error> where
T: ByteOrder,
Writes a signed 64 bit integer to the underlying writer. Read more
sourcefn write_u128<T>(&mut self, n: u128) -> Result<(), Error> where
T: ByteOrder,
fn write_u128<T>(&mut self, n: u128) -> Result<(), Error> where
T: ByteOrder,
Writes an unsigned 128 bit integer to the underlying writer.
sourcefn write_i128<T>(&mut self, n: i128) -> Result<(), Error> where
T: ByteOrder,
fn write_i128<T>(&mut self, n: i128) -> Result<(), Error> where
T: ByteOrder,
Writes a signed 128 bit integer to the underlying writer.
sourcefn write_uint<T>(&mut self, n: u64, nbytes: usize) -> Result<(), Error> where
T: ByteOrder,
fn write_uint<T>(&mut self, n: u64, nbytes: usize) -> Result<(), Error> where
T: ByteOrder,
Writes an unsigned n-bytes integer to the underlying writer. Read more
sourcefn write_int<T>(&mut self, n: i64, nbytes: usize) -> Result<(), Error> where
T: ByteOrder,
fn write_int<T>(&mut self, n: i64, nbytes: usize) -> Result<(), Error> where
T: ByteOrder,
Writes a signed n-bytes integer to the underlying writer. Read more
sourcefn write_uint128<T>(&mut self, n: u128, nbytes: usize) -> Result<(), Error> where
T: ByteOrder,
fn write_uint128<T>(&mut self, n: u128, nbytes: usize) -> Result<(), Error> where
T: ByteOrder,
Writes an unsigned n-bytes integer to the underlying writer. Read more
sourcefn write_int128<T>(&mut self, n: i128, nbytes: usize) -> Result<(), Error> where
T: ByteOrder,
fn write_int128<T>(&mut self, n: i128, nbytes: usize) -> Result<(), Error> where
T: ByteOrder,
Writes a signed n-bytes integer to the underlying writer. Read more