Scala-io output litte or big endian as unsigned short.

104 views
Skip to first unread message

Brandon Luth

unread,
Sep 23, 2012, 7:35:11 PM9/23/12
to scala-i...@googlegroups.com
Hey All,

I was wondering how one would go about achieving a similar outcome to the following using scala-io?

In python I have struct.pack( ">H", word ), which writes to a file the int given by word as a unsigned short using Big Endianness.

Any obvious way to do this with scala-io?

Thanks!

Jesse Eichar

unread,
Sep 25, 2012, 2:19:14 AM9/25/12
to scala-i...@googlegroups.com
Sadly at the moment there is no out-of-the-box solution for this.  You have to do the same as in Java.  I intend to implement more OutputConverters to allow better control for writing and this is one way you could implement you solution (and contribute back to scala-io :-) ).

Jesse

Brandon Luth

unread,
Sep 27, 2012, 12:43:56 PM9/27/12
to scala-i...@googlegroups.com
I'll look into that :P
Reply all
Reply to author
Forward
0 new messages