hi guys, i would like to read in a vector as inputstream for some processing.
the current code i have is
ByteArrayOutputStream tmpbyte = new ByteArrayOutputStream();
ObjectOutputStream tmpobjstream = new ObjectOutputStream(tmpbyte);
tmpobjstream.writeObject(thevector);
tmpobjstream.flush();
byte[] tmpbytearray = tmpbyte.toByteArray();
ByteArrayInputStream tmpbytestream = new ByteArrayInputStream(tmpbytearray);
ObjectInputStream tmpobjstream = new ObjectInputStream(tmpbytestream);
it does work but it looks stupid having to deserialise the vector using outputstream then to byte[] then to inputstream. is there a better way?
the current code i have is
ByteArrayOutputStream tmpbyte = new ByteArrayOutputStream();
ObjectOutputStream tmpobjstream = new ObjectOutputStream(tmpbyte);
tmpobjstream.writeObject(thevector);
tmpobjstream.flush();
byte[] tmpbytearray = tmpbyte.toByteArray();
ByteArrayInputStream tmpbytestream = new ByteArrayInputStream(tmpbytearray);
ObjectInputStream tmpobjstream = new ObjectInputStream(tmpbytestream);
it does work but it looks stupid having to deserialise the vector using outputstream then to byte[] then to inputstream. is there a better way?