https://github.com/kelindar/iostream
Simple binary reader and writer
https://github.com/kelindar/iostream
Last synced: about 1 month ago
JSON representation
Simple binary reader and writer
- Host: GitHub
- URL: https://github.com/kelindar/iostream
- Owner: kelindar
- License: mit
- Created: 2021-12-11T18:28:36.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-28T17:55:52.000Z (7 months ago)
- Last Synced: 2025-03-27T13:03:57.927Z (about 2 months ago)
- Language: Go
- Size: 52.7 KB
- Stars: 11
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
## Simple Binary Stream Reader/Writer
This package contains a set of simple utility reader and writer that can be used to efficiently read/write binary information over the wire.
```go
import "github.com/kelindar/iostream"
```## Usage
In order to use it, you can simply instantiate either a `Reader` or a `Writer` which require an `io.Reader` or `io.Writer` respectively. Here's a simple example
```go
// Fake stream
stream := bytes.NewBuffer(nil)// Write some data into the stream...
w := iostream.NewWriter(stream)
w.WriteString("Roman")
w.WriteUint32(36)// Read the data back...
r := iostream.NewReader(stream)
name, err := r.ReadString()
age, err := r.ReadUint32()
```## Contributing
We are open to contributions, feel free to submit a pull request and we'll review it as quickly as we can. This library is maintained by [Roman Atachiants](https://www.linkedin.com/in/atachiants/)
## License
Tile is licensed under the [MIT License](LICENSE.md).