An open API service indexing awesome lists of open source software.

https://github.com/borud/recio

RecordIO - A trivial library for writing records to a writer.
https://github.com/borud/recio

Last synced: 25 days ago
JSON representation

RecordIO - A trivial library for writing records to a writer.

Awesome Lists containing this project

README

          

# RecordIO

[![Go Reference](https://pkg.go.dev/badge/github.com/borud/recio.svg)](https://pkg.go.dev/github.com/borud/recio)

This library implements a simple `Reader` and `Writer` pair for length prefixed records. This is suitable for writing serialized data records to a disk file. The datastream consists of unsigned 32 bit integer (little endian) indicating the length of a payload, followed by the payload itself.

When using this you have to make sure to give record sizes some thought. When you read records you want the supplied buffer to be large enough to hold the messages you are reading. If your target buffer isn't large enough you will get an `ErrTargetBufferTooSmall` error.