# `BAM.Sink`
[🔗](https://github.com/baoulo/bam-elixir/blob/v0.1.0/lib/bam/sink.ex#L1)

Byte sink for the BAM writer.

`write/2` appends iodata. `close/1` releases the sink. `BAM.Sink.File`
writes a local file. `BAM.Sink.Memory` keeps the bytes so a test can
inspect them without touching the filesystem.

# `state`

```elixir
@type state() :: term()
```

Opaque handle owned by one sink implementation.

# `close`

```elixir
@callback close(state()) :: {:ok, state()} | {:error, BAM.Error.t()}
```

# `write`

```elixir
@callback write(state(), iodata()) :: {:ok, state()} | {:error, BAM.Error.t()}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
