File: Read_BitVec.md

package info (click to toggle)
rust-coreutils 0.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 505,620 kB
  • sloc: ansic: 103,594; asm: 28,570; sh: 8,910; python: 5,581; makefile: 472; cpp: 97; javascript: 72
file content (14 lines) | stat: -rw-r--r-- 547 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Reading From a Bit-Vector

The implementation loads bytes out of the reference bit-vector until either the
destination buffer is filled or the source has no more bytes to provide. When
`.read()` returns, the provided bit-vector will have its contents shifted down
so that it begins at the first bit *after* the last byte copied out into `buf`.

Note that the return value of `.read()` is always the number of *bytes* of `buf`
filled!

## API Differences

The standard library does not `impl Read for Vec<u8>`. It is provided here as a
courtesy.