return new ByteArrayInputStream(baos.toByteArray());
}
public long sizeOf(Object obj) {
try {
CountingOutputStream c = new CountingOutputStream(new NullOutputStream());
ObjectOutputStream stream = new ObjectOutputStream(c);
stream.writeObject(obj);
stream.close();
return c.getBytesWritten();
} catch (IOException ex) {