public abstract class CommittingOutputStream extends OutputStream
OutputStream.
This class may be overridden to provide the commit functionality.| Constructor and Description |
|---|
CommittingOutputStream()
Construct a new instance.
|
CommittingOutputStream(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 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(OutputStream adaptedOutput)
adaptedOutput - the adapted output stream.IllegalArgumentException - if adaptedOutput is null.public void write(byte[] b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionprotected OutputStream getOutputStream() throws IOException
IOException - if obtaining of an output stream fails (e.g. connection problem).protected abstract void commit()
throws IOException
IOExceptionCopyright © 2016 Oracle Corporation. All rights reserved.