ByteArrayOutputStream for modified objects