# FixIO Documentation

Back to summary

`import "io/stream";`

## BufferedStream class

Adds buffering to another stream.

Inherits from Stream.

### Initialization

`static function create(parent: Stream): BufferedStream`
  Creates a new buffered stream.

### Utility functions

`function read_line(buf: Byte[]): Byte[]
function read_line(buf: Byte[], max_bytes: Integer): Byte[]
`
  Reads a line delimited by LF or CRLF. The provided buffer is cleared before reading and the newline characters are not included. You can optionally limit the maximum length of the line (pass negative value to remove the limit). Returns the buffer or `null` when the end of the stream is reached.
`function read_null_string(): Byte[]
function read_null_string(str: Byte[]): Byte[]
function read_null_string(str: Byte[], max_bytes: Integer): Byte[]
`
  Reads null terminated byte string. Optionally it can append it into the provided string. You can also optionally limit the maximum length of the string (pass negative value to remove the limit).