|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||

java.lang.Objectorg.xlightweb.BodyDataSink
public abstract class BodyDataSink
I/O resource capable of sending the body data.
| Method Summary | |
|---|---|
abstract void |
addDestroyListener(IBodyDestroyListener destroyListener)
add a destroy listener |
void |
close()
|
abstract void |
closeQuitly()
closes this connection by swallowing io exceptions |
abstract void |
destroy()
destroys this data sink |
abstract void |
flush()
|
abstract Object |
getAttachment()
Retrieves the current attachment. |
abstract String |
getEncoding()
gets the default encoding |
abstract IConnection.FlushMode |
getFlushmode()
see IConnection#getFlushmode() |
abstract String |
getId()
|
abstract boolean |
isAutoflush()
get autoflush |
boolean |
isMultipart()
|
abstract boolean |
isOpen()
returns true if the data sink is open |
abstract void |
markWritePosition()
Marks the write position in the connection. |
abstract void |
removeWriteMark()
remove the write mark |
abstract boolean |
resetToWriteMark()
Resets to the marked write position. |
abstract void |
setAttachment(Object obj)
Attaches the given object to this connection |
abstract void |
setAutoflush(boolean autoflush)
set autoflush. |
abstract void |
setEncoding(String defaultEncoding)
sets the default encoding |
abstract void |
setFlushmode(IConnection.FlushMode flushMode)
see IConnection#setFlushmode(FlushMode) |
abstract void |
setSendTimeoutMillis(long sendTimeoutMillis)
set the sendtimout |
abstract long |
transferFrom(BodyDataSource source)
transfer all data from the data source |
abstract long |
transferFrom(BodyDataSource source,
int length)
transfer data from the data source |
abstract long |
transferFrom(FileChannel fileChannel)
|
long |
transferFrom(InputStream is)
transfer all data from the data source |
abstract long |
transferFrom(NonBlockingBodyDataSource source)
transfer the available data from the data source |
abstract long |
transferFrom(NonBlockingBodyDataSource source,
int length)
transfer the available data from the data source |
long |
transferFrom(ReadableByteChannel source)
|
abstract long |
transferFrom(ReadableByteChannel source,
int chunkSize)
|
int |
write(byte... bytes)
|
int |
write(byte b)
|
int |
write(byte[] bytes,
int offset,
int length)
|
abstract int |
write(ByteBuffer buffer)
|
abstract long |
write(ByteBuffer[] buffers)
|
long |
write(ByteBuffer[] srcs,
int offset,
int length)
|
abstract void |
write(ByteBuffer[] buffers,
IWriteCompletionHandler writeCompletionHandler)
writes a buffer array |
int |
write(double d)
|
int |
write(int i)
|
long |
write(List<ByteBuffer> buffers)
|
int |
write(long l)
|
int |
write(short s)
|
int |
write(String message)
|
BodyDataSink |
writePart(IHeader partHeader)
|
void |
writePart(IPart part)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public boolean isMultipart()
public abstract void setSendTimeoutMillis(long sendTimeoutMillis)
sendTimeoutMillis - the send timeout
public abstract void flush()
throws IOException
flush in interface FlushableIOException
public final void close()
throws IOException
close in interface Closeableclose in interface ChannelIOExceptionpublic abstract void closeQuitly()
public abstract void write(ByteBuffer[] buffers,
IWriteCompletionHandler writeCompletionHandler)
throws IOException
buffers - the buffers to writewriteCompletionHandler - the completion handler
IOException - if an exception occurs
public abstract int write(ByteBuffer buffer)
throws IOException,
BufferOverflowException
write in interface WritableByteChannelwrite in interface IDataSinkIOException
BufferOverflowException
public abstract long write(ByteBuffer[] buffers)
throws IOException,
BufferOverflowException
write in interface GatheringByteChannelwrite in interface IDataSinkIOException
BufferOverflowException
public abstract long transferFrom(ReadableByteChannel source,
int chunkSize)
throws IOException,
BufferOverflowException
transferFrom in interface IDataSinkIOException
BufferOverflowException
public abstract long transferFrom(FileChannel fileChannel)
throws IOException,
BufferOverflowException
transferFrom in interface IDataSinkIOException
BufferOverflowException
public abstract long transferFrom(NonBlockingBodyDataSource source)
throws IOException
source - the data source
IOException - if an exception occurs
public abstract long transferFrom(NonBlockingBodyDataSource source,
int length)
throws IOException
source - the data sourcelength - the length to transfer
IOException - if an exception occurs
public abstract long transferFrom(BodyDataSource source)
throws IOException
source - the data source
IOException - if an exception occurs
public abstract long transferFrom(BodyDataSource source,
int length)
throws IOException
source - the data sourcelength - the length to transfer
IOException - if an exception occurs
public final long transferFrom(InputStream is)
throws IOException
source - the data source
IOException - if an exception occurs
public final long transferFrom(ReadableByteChannel source)
throws IOException,
BufferOverflowException
transferFrom in interface IDataSinkIOException
BufferOverflowException
public final int write(byte b)
throws IOException,
BufferOverflowException
write in interface IDataSinkIOException
BufferOverflowException
public final int write(byte... bytes)
throws IOException,
BufferOverflowException
write in interface IDataSinkIOException
BufferOverflowException
public final int write(byte[] bytes,
int offset,
int length)
throws IOException,
BufferOverflowException
write in interface IDataSinkIOException
BufferOverflowException
public final long write(ByteBuffer[] srcs,
int offset,
int length)
throws IOException
write in interface GatheringByteChannelwrite in interface IDataSinkIOException
public final long write(List<ByteBuffer> buffers)
throws IOException,
BufferOverflowException
write in interface IDataSinkIOException
BufferOverflowException
public final int write(int i)
throws IOException,
BufferOverflowException
write in interface IDataSinkIOException
BufferOverflowException
public final int write(short s)
throws IOException,
BufferOverflowException
write in interface IDataSinkIOException
BufferOverflowException
public final int write(long l)
throws IOException,
BufferOverflowException
write in interface IDataSinkIOException
BufferOverflowException
public final int write(double d)
throws IOException,
BufferOverflowException
write in interface IDataSinkIOException
BufferOverflowException
public final int write(String message)
throws IOException,
BufferOverflowException
write in interface IDataSinkIOException
BufferOverflowException
public final BodyDataSink writePart(IHeader partHeader)
throws IOException,
BufferOverflowException
IOException
BufferOverflowException
public final void writePart(IPart part)
throws IOException,
BufferOverflowException
IOException
BufferOverflowExceptionpublic abstract void setEncoding(String defaultEncoding)
defaultEncoding - the default encodingpublic abstract String getEncoding()
public abstract void setFlushmode(IConnection.FlushMode flushMode)
IConnection#setFlushmode(FlushMode)
public abstract IConnection.FlushMode getFlushmode()
IConnection#getFlushmode()
public abstract void setAutoflush(boolean autoflush)
autoflush - true if autoflush should be activatedpublic abstract boolean isAutoflush()
public abstract void markWritePosition()
public abstract boolean resetToWriteMark()
public abstract void removeWriteMark()
public abstract void setAttachment(Object obj)
obj - The object to be attached; may be nullpublic abstract Object getAttachment()
public abstract boolean isOpen()
isOpen in interface Channelpublic abstract String getId()
public abstract void destroy()
destroy in interface IDestroyablepublic abstract void addDestroyListener(IBodyDestroyListener destroyListener)
destroyListener - the destroy listener to add
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||