Tim Hunter
7/2/2007 2:20:00 PM
On Jul 2, 4:19 am, Vu Nang Luc <vunang...@yahoo.com> wrote:
> Dear all,
>
> I've tried Ruby for some time. The language is pretty nice but now I
> need some operations with binary data. I tried but I still can not
> find out what to use?
>
> What I really need is:
> a = 3;
> b = ~a;
> c = a >>; ......
> and some some class to handle an array of bytes.
>
> I think the ability to manage binary data is vital for any languge,
> can you tell me which functions to use?
>
> Sincerely,
>
> VNLuc
In Ruby we use the String class to hold bytes. Search this group's
archives for "binary file". Check out the Array#pack and String#unpack
methods.