public class ServerOutputStreamImpl extends ServerOutputStream
ServerOutputStream
implementation.Constructor and Description |
---|
ServerOutputStreamImpl(WriteBufferReceiver receiver,
int sendBufferSize)
Initiate.
|
ServerOutputStreamImpl(WriteBufferReceiver receiver,
int sendBufferSize,
Serializable stateMomento)
Initiate.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the content.
|
void |
close() |
Serializable |
exportState(Writer writer)
Exports a momento for the current state of this
ServerOutputStream . |
void |
flush() |
void |
write(ByteBuffer cachedBuffer)
Writes a cached
ByteBuffer . |
void |
write(int b) |
write, write
public ServerOutputStreamImpl(WriteBufferReceiver receiver, int sendBufferSize)
receiver
- WriteBufferReceiver
.sendBufferSize
- Send buffer size.public ServerOutputStreamImpl(WriteBufferReceiver receiver, int sendBufferSize, Serializable stateMomento)
receiver
- WriteBufferReceiver
.sendBufferSize
- Send buffer size.stateMomento
- Momento containing the state for this
ServerOutputStream
.public Serializable exportState(Writer writer) throws DataWrittenException, IOException
ServerOutputStream
.writer
- Optional Writer
to flush its contents before obtaining
the state for the momento.ServerOutputStream
.DataWrittenException
- Should data have already been written to the client.IOException
- If fails to flush data of Writer
.public void clear() throws IOException
IOException
- If content already provided to WriteBufferReceiver
.public void write(ByteBuffer cachedBuffer) throws IOException
ServerOutputStream
Writes a cached ByteBuffer
.
This is to enable efficient I/O of writing cached content.
write
in class ServerOutputStream
cachedBuffer
- Cached ByteBuffer
that should never change its
content.IOException
- If fails to write the ByteBuffer
.public void write(int b) throws IOException
write
in class ServerOutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class ServerOutputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class ServerOutputStream
IOException
Copyright © 2005–2016. All rights reserved.