binary_reader v0.1.0 BinaryReader

Warning: This module has side effects.

a_int = BinaryReader.read_int32(pid)

Each action like this will cost a side effect, chaging the binary content that inputed initailly. Be careful to use it according to your needs.

Link to this section Summary

Functions

Move the reading pivot to certain index

Read one byte

Read number of bytes

Read 2 bytes for int16

Read 4 bytes for int32

Read 8 bytes for int64

Read 4 bytes for string

Return remains size of bytes

Start the GenServer

Stop the GenServer

Link to this section Functions

Link to this function

move_pivot_to(pid, index)

Specs

move_pivot_to(pid(), integer()) :: :ok

Move the reading pivot to certain index

Specs

read_byte(pid()) :: binary()

Read one byte

Link to this function

read_bytes(pid, size)

Specs

read_bytes(pid(), integer()) :: binary()

Read number of bytes

Link to this function

read_int16(pid)

Specs

read_int16(pid()) :: integer()

Read 2 bytes for int16

Link to this function

read_int32(pid)

Specs

read_int32(pid()) :: integer()

Read 4 bytes for int32

Link to this function

read_int64(pid)

Specs

read_int64(pid()) :: integer()

Read 8 bytes for int64

Link to this function

read_string(pid)

Specs

read_string(pid()) :: String.t()

Read 4 bytes for string

Link to this function

remains_byte_size(pid)

Specs

remains_byte_size(pid()) :: binary()

Return remains size of bytes

Link to this function

start_link(content)

Specs

start_link(binary()) :: {:ok, pid()}

Start the GenServer

Specs

stop(pid()) :: :ok

Stop the GenServer