Java makes me sad since it needs wrapper classes for ArrayList
s. How would I go about adding a byte[]
to a ArrayList<Byte[]>
?
views:
111answers:
2
+2
A:
LOL thought I had to wrap everything. ArrayList<byte[]>
works. Thanks Yishai.
CSharpLover
2010-02-11 21:31:58
A:
You have to wrap any primitives to use them in a context that requires an object. But a byte[] is not a primitive. It's an array of bytes, and an array is an object.
Just to clarify: Do you really want an ArrayList of arrays of bytes, i.e. effectively a two-dimensional array? Or do you really simply want an ArrayList of bytes? In that case, you would have to wrap the bytes in Bytes to put them in the ArrayList.
Jay
2010-02-11 22:37:21