Project

bytebuffer

0.0
The project is in a healthy, maintained state
A gem that provides a ByteBuffer class based on the bytebuffer rust crate.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 13.0
~> 3.12
~> 0.9

Runtime

~> 1.17
 Project Readme

Gem Version

ByteBuffer

The ByteBuffer Ruby gem provides a powerful and flexible interface for buffered IO data, wrapping the bytebuffer crate using FFI.

Overview

ByteBuffer offers an interface to the compiled rust library for manipulating buffered IO, e.g. reading and writing bits, bytes, integers of various sizes, and floats.

Getting Started

Dependencies

The following packages are required to build and use the gem:

  • ruby >= 3.0
  • rustc
  • cargo

Ensure the following toolchains are installed via rustup:

  • x86_64-unknown-linux-gnu

Usage

A basic example of the ByteBuffer in action can be found below:

require 'bytebuffer'

bb = ByteBuffer.new
bb.write_i32(-128)
puts bb.read_i32 # Output: -128
bb.free