0.0
Low commit activity in last 3 years
No release in over a year
An array buffer (a.k.a. byte array) implementation forRuby, implemented natively.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.9
 Project Readme

arraybuffer gem

Tests Gem Version

What?

Ruby lacks classes like array buffer or byte array.

This gem aims to solve that by implementing that natively in C so that a decent performance can be achieved.

The design of the classes follows standards that are implemented in the Web world, like:

The standards above are, however, not strictly followed.

Why?

The only way I found to do this was manipulating an array of numbers treating them as bytes and using buffer.pack('C*') to transform it into a String object. However, for some reason the Array#pack method is painfully slow.

Other gems exist out there, like the class ByteBuffer class in nio4r. However, they didn't had a design I was satisfied with or they had different purposes that wouldn't suit my use case :)

What about JRuby?

Feel free to open a pull request for that!