AppendingObjectOutputStream.java
package org.microspace.replicator;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
/**
* An output stream that does not send header for the stream.
* It is good for appending.
*
* @author Gaspar Sinai - {@literal gaspar.sinai@microspace.org}
* @version 2016-06-26
*/
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();
}
}