Hi there,
I am trying to write a method that accepts an array of any primitive
type and will return the same array without copying memory as an array
of bytes.
ie. I'd like to be able to do something like:
char[] chars = "Hello!";
byte[] bytes = (byte[]) chars;
which obviously won't work.
Is there any way of casting arrays?
Thanks for any help you can give me.
Matt
I am trying to write a method that accepts an array of any primitive
type and will return the same array without copying memory as an array
of bytes.
ie. I'd like to be able to do something like:
char[] chars = "Hello!";
byte[] bytes = (byte[]) chars;
which obviously won't work.
Is there any way of casting arrays?
Thanks for any help you can give me.
Matt
Comment