Hi Jan,

I think I will add the ByteArray accessor to NBExternalAddress today
or tomorrow since I need it as well for another project.

Concerning the Streams, I think it is the easiest solution to wrap around
a ByteArray. Otherwise you could subclass one of the main stream classes
and implement your own primitive methods with FFI to read and write bytes.
In the worst case you will have to implement all primitive methods with FFI
that you find in the StandardFileStream.


On 2013-09-22, at 10:12, Jan van de Sandt <jvdsa...@gmail.com> wrote:
> Hello,
> 
> I'm trying to implement a binary ReadStream that gets its data not from a
> Smalltalk collection but from some external memory address. I got this
> address from a library call using NativeBoost.
> 
> The NBExternalAddress has methods to access bytes, int's and longs but
> there is no method to get a ByteArray starting at a specified offset and
> with a specified length. I need a method like this to implement the
> ReadStream>>next: method efficiently.
> 
> Is it possible ti implement such a method or are there other ways to
> implement a ReadStream efficiently?
> 
> In [1] I read that there was already an idea to implement a nbAddressAt:
> method. This would also be using in combination with NativeBoost
> class>>#memCopy:to:size
> 
> Regrads,
> Jan.
> 
> [1]
> http://forum.world.st/Pharo-dev-NB-Review-amp-fixes-amp-ideas-td4698514.html

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to