Package org.glassfish.jersey.io.spi
Interface FlushedCloseable
-
- All Superinterfaces:
AutoCloseable,Closeable,Flushable
public interface FlushedCloseable extends Flushable, Closeable
A marker interface that the stream provided to Jersey can implement, noting that the stream does not need to callFlushable.flush()prior toclose(). That way,Flushable.flush()method is not called twice.Usable by
javax.ws.rs.client.ClientRequestContext#setEntityStream(OutputStream). Usable byjavax.ws.rs.container.ContainerResponseContext#setEntityStream(OutputStream).This marker interface can be useful for the customer OutputStream to know the
flushdid not come from Jersey before close. By default, when the entity stream is to be closed by Jersey,flushis called first.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Flushes this stream by writing any buffered output to the underlying stream.
-
-
-
Method Detail
-
close
void close() throws IOExceptionFlushes this stream by writing any buffered output to the underlying stream. Then closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.As noted in
AutoCloseable.close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark theCloseableas closed, prior to throwing theIOException.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- if an I/O error occurs
-
-