It looks like you're asking how to store a Vector<String>
in a byte array. This sounds weird, so maybe I've interpreted it wrong.
Vector
s are serializable. You can use anObjectOutputStream
to write them to an output stream.ByteArrayOutputStream
implements anOutputStream
that writes to memory. It has a methodtoByteArray()
that you can call to get its contents as a byte array.
That should be enough to solve this problem.
edit: maybe also some System.arraycopy
if you need it to go in the data
argument... again, weird.