# Writer

`import { Writer } from "destack:sync";`

Byte writer.

```ds title="Writer"
export interface Writer {
    write(buffer: &'a readonly [uint8]): Result<usize, IoError>;
    flush(): Result<void, IoError>;
}
```

[language/library/src/sync/writer.ds:4:10](https://github.com/destack-sh/destack/blob/main/language/library/src/sync/writer.ds#L4-L10)

## Members

### `write(buffer: &'a readonly [uint8]): Result<usize, IoError>`

Write bytes from `buffer`.

### `flush(): Result<void, IoError>`

Flush buffered writes.
