ExBin v0.1.0 ExBin View Source
Documentation for ExBin.
Link to this section Summary
Functions
Retrives the byte at index index
(zero-based) from binary
Creates a stream for fetching bytes within a binary. Ideal for large volumes of bytes, or large binaries
Link to this section Functions
Link to this function
byte_at(binary, index) View Source
Retrives the byte at index index
(zero-based) from binary
.
If the binary is empty, or already exhausted, byte_at will
return {:error, :index_out_of_bounds}
.
Link to this function
byte_stream(binary) View Source
Creates a stream for fetching bytes within a binary. Ideal for large volumes of bytes, or large binaries.
Examples
iex> ExBin.byte_stream(<<0x01, 0x02, 0x03>>) |> Enum.take(2)
[1, 2]