# std.io: introduce buffered I/O and change API · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/4543413491078c53d24115c5229989cda05cb1a5)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 4543413491078c53d24115c5229989cda05cb1a5

Requested commit: 4543413491078c53d24115c5229989cda05cb1a5

Commit: 4543413491078c53d24115c5229989cda05cb1a5

Tree: f4ff1922be22c9ac8d9bf80801abeb67afdfa1af

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.io: introduce buffered I/O and change API

I started working on #465 and made some corresponding std.io
API changes.

New structs:
 * std.io.FileInStream
 * std.io.FileOutStream
 * std.io.BufferedOutStream
 * std.io.BufferedInStream

Removed:
 * std.io.File.in_stream
 * std.io.File.out_stream

Now instead of &file.out_stream or &file.in_stream to get access to
the stream API for a file, you get it like this:

var file_in_stream = io.FileInStream.init(&file);
const in_stream = &file_in_stream.stream;

var file_out_stream = io.FileOutStream.init(&file);
const out_stream = &file_out_stream.stream;

This is evidence that we might not need any OOP features -
See #130.

```

## Parents

- [634e8713c394bacfe080d03256d1dd4f9a43dd8c](https://git.cafe/gitcafe/zig/commit/634e8713c394bacfe080d03256d1dd4f9a43dd8c?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/4543413491078c53d24115c5229989cda05cb1a5?format=markdown)
