|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
org.glassfish.jersey.internal.util.CommittingOutputStream
public abstract class CommittingOutputStream
An abstract committing output stream adapter that performs a commit before the first byte is written to the adapted OutputStream.
Concrete implementations of the class typically override the commit operation
to perform any initialization on the adapted output stream.
| Constructor Summary | |
|---|---|
CommittingOutputStream()
Construct a new committing output stream using a deferred initialization of the adapted output stream. |
|
CommittingOutputStream(java.io.OutputStream out)
Construct a new committing output stream using an eager initialization of the adapted output stream. |
|
| Method Summary | |
|---|---|
void |
close()
|
protected abstract void |
commit()
Perform the commit functionality. |
void |
flush()
|
protected java.io.OutputStream |
getOutputStream()
Get the adapted output stream. |
boolean |
isCommitted()
Determines whether the stream was already committed or not. |
void |
write(byte[] b)
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CommittingOutputStream()
getOutputStream() MUST be overridden to return
the adapted output stream.
adapting constructorpublic CommittingOutputStream(java.io.OutputStream out)
getOutputStream() will be ignored and never
invoked to retrieve the adapted output stream.
out - the adapted output stream.
java.lang.IllegalArgumentException - if supplied output stream is null.deferred initialization constructor| Method Detail |
|---|
public boolean isCommitted()
true if this stream was already committed, false otherwise.
public void write(byte[] b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOException
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOException
public void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOException
public void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOException
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.OutputStreamjava.io.IOException
protected java.io.OutputStream getOutputStream()
throws java.io.IOException
adapting constructor) as part of the commit operation immediately after
the commit() method has been invoked.
This method MUST be overridden if the empty deferred initialization constructor is utilized to construct an instance
of this class.
java.io.IOException
protected abstract void commit()
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||