<br><br><div class="gmail_quote">On Tue, Feb 8, 2011 at 2:26 PM, Michael Snoyman <span dir="ltr">&lt;<a href="mailto:michael@snoyman.com" target="_blank">michael@snoyman.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Your array contains machine-sized Ints, which in practice are likely<br>
either 32-bit or 64-bit, while a ByteString is the equivalent of an<br>
array or 8-bit values. So you&#39;ll need to somehow convert the Ints to<br>
Word8s. Do you know if you need big or little endian?<br>
<br>
A basic approach would be:<br>
<br>
* Use freeze to convert your IOArray into an IArray<br>
* Use putIArrayOf and put (from cereal) to generate a Putter value<br>
* Use runPut to generate a ByteString from that<br>
<br></blockquote><div><br></div><div>Thanks Michael,</div><div>Actually, I need an array of 8-bit words - Is that available?</div><div><br></div><div>Also, would be hard to do it without cereal? </div><div><br></div><div>
Regards,</div><div>Kashyap</div></div>