1 Dec 2010 17:44
Re: [armedbear-devel] is there a good method to read/write java byte arrays?
Mark Evenson <evenson <at> panix.com>
2010-12-01 16:44:32 GMT
2010-12-01 16:44:32 GMT
On 3/17/10 5:32 PM, Alessio Stalla wrote: > On Wed, Mar 17, 2010 at 5:22 PM, Mark Evenson<evenson <at> panix.com> wrote: >> On 3/17/10 5:04 PM, Alessio Stalla wrote: >> […] >> >>> I wrote sys::%make-byte-array-output-stream in order to make the >>> runtime compiler capable of generating bytecode without using >>> temporary files; it wasn't meant to be used by the ABCL user, and as >>> such it's not very polished (for example, the type of a >>> byte-array-output-stream is simply STREAM). In any case, it's defined >>> in the ByteArrayOutputStream Java class, and as you correctly noted, >>> it explicitly sets the element type to (unsigned-byte 8). As a quick >>> and dirty solution, you could more or less copy-paste that class and >>> replace "output" with "input" :) (as well as update Autoload.java to >>> make ABCL know of the new primitives). >>> >>> We should probably polish it a bit and release it as an extension. >> >> Well, at least we should quickly whip out the inverse version so David >> doesn't have to rely on hacking Stream.java (although I'm not sure when >> telling Stream that initAsBinaryStream() means a format of unsigned 8bit >> bytes will fail). >> >> I think we can commit to the interface you've implemented in >> ByteArrayOutputStream, as those are the basic necessary operations. >> >> Or maybe I am not seeing what potential problems there would be with >> this as a short-term strategy, Alessio? > > No problem at all in the implementation per se; however, when we'll(Continue reading)
RSS Feed