How can I convert an Object to Inputstream

You can use ObjectOutputStream You write the object (obj in the code below) to the ObjectOutputStream, your object you want to convert to an input stream must implement Serializable. ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject(obj); oos.flush(); oos.close(); InputStream is = new ByteArrayInputStream(baos.toByteArray());

Appending to an ObjectOutputStream

Here’s the trick: subclass ObjectOutputStream and override the writeStreamHeader method: public class AppendingObjectOutputStream extends ObjectOutputStream { public AppendingObjectOutputStream(OutputStream out) throws IOException { super(out); } @Override protected void writeStreamHeader() throws IOException { // do not write a header, but reset: // this line added after another question // showed a problem with the original reset(); } … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)