On Mon, Aug 15, 2011 at 12:16 PM, mimocrocodil <4deni...@gmail.com> wrote:

> I obtain immutable(byte)* and int where contained length of bytes block
> from C library.
>
> Can I convert this into byte[] without explict copying etc.
>
> Something like:
>
> byte* p; // bytes
> int size; // size of bytes block
>
> byte[] b;
> b.length = size;
> b.ptr = p;
>
> // now b contains bytes from library
>


Yes:

byte[] b = p[0 .. size];

Reply via email to