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.OutputStream
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
protected 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.IOException
Copyright © 2016 Oracle Corporation. All Rights Reserved.