public abstract class CommittingOutputStream
extends java.io.OutputStream
OutputStream.
This class may be overridden to provide the commit functionality.| Constructor and Description |
|---|
CommittingOutputStream()
Construct a new instance.
|
CommittingOutputStream(java.io.OutputStream adaptedOutput)
Construct a new instance with an output stream to adapt.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected abstract void |
commit()
Perform the commit functionality.
|
void |
flush() |
protected java.io.OutputStream |
getOutputStream()
Get the adapted output stream.
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
public CommittingOutputStream()
getOutputStream() MUST be overridden
to return an output stream.public CommittingOutputStream(java.io.OutputStream adaptedOutput)
adaptedOutput - the adapted output stream.java.lang.IllegalArgumentException - if adaptedOutput is null.public void write(byte[] b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOExceptionprotected java.io.OutputStream getOutputStream()
throws java.io.IOException
java.io.IOException - if obtaining of an output stream fails (e.g. connection problem).protected abstract void commit()
throws java.io.IOException
java.io.IOExceptionCopyright © 2016 Oracle Corporation. All Rights Reserved.