public abstract class AbstractContentSource extends Object implements ContentSource
ContentSource interface. This class has
implementation of all the write operations defined in contract
ContentSource| Modifier and Type | Field and Description |
|---|---|
static int |
BUFFER_SIZE |
| Constructor and Description |
|---|
AbstractContentSource() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
write(byte[] bytes,
int offset,
int length,
OutputStream os)
Drain byte array content to
OutputStream instance. |
protected void |
write(byte[] bytes,
int offset,
int length,
Socket socket)
Drain byte array content to
OutputStream instance. |
protected int |
write(byte[] bytes,
int offset,
int length,
SocketChannel channel)
Drain content from byte array to
SocketChannel |
protected void |
write(byte[] bytes,
OutputStream os)
Drain byte array content to
OutputStream instance. |
protected void |
write(byte[] bytes,
Socket socket)
Drain byte array content to
OutputStream instance. |
protected int |
write(byte[] bytes,
SocketChannel channel)
Drain content from byte array to
SocketChannel |
protected long |
write(InputStream is,
OutputStream os)
Read content from given inputstream and write it onto the
OutputStream; essentially this method drains the
InputStream content onto OutputStream |
protected long |
write(InputStream is,
Socket socket)
Write data onto a
Socket from an InputStream |
protected long |
write(InputStream is,
SocketChannel channel)
Write data onto a
SocketChannel from an InputStream |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLength, writeTo, writeTo, writeTopublic static final int BUFFER_SIZE
protected long write(InputStream is, SocketChannel channel) throws IOException
SocketChannel from an InputStreamis - InputStream instance from which data will be readchannel - SocketChannel on which data will be written toSocketChannelIOException - if any IO error occurs during writingprotected int write(byte[] bytes,
SocketChannel channel)
throws IOException
SocketChannelbytes - content to be drained onto SocketChannelchannel - SocketChannel on which content will be writtenIOException - if IO error occurs during writeprotected int write(byte[] bytes,
int offset,
int length,
SocketChannel channel)
throws IOException
SocketChannelbytes - byte array with contentoffset - index of first byte to be readlength - number of bytes to be read starting from offset indexchannel - SocketChannel on which content to be writtenIOException - if IO error occurs during writeprotected long write(InputStream is, Socket socket) throws IOException
Socket from an InputStreamis - InputStream instance from which data will be readsocket - Socket on which data will be written toSocketChannelIOException - if any IO error occurs duriing writtingprotected long write(InputStream is, OutputStream os) throws IOException
OutputStream; essentially this method drains the
InputStream content onto OutputStreamis - inputstream from which content will be reados - outputstream on which content will be writtenIOException - if IO error during writting or readingprotected void write(byte[] bytes,
Socket socket)
throws IOException
OutputStream instance.bytes - byte array with contentsocket - Socket on which content will be writtenIOException - if IO error occursprotected void write(byte[] bytes,
int offset,
int length,
Socket socket)
throws IOException
OutputStream instance.bytes - byte array with contentoffset - offsetlength - lengthsocket - Socket on which content will be writtenIOException - if IO error occursprotected void write(byte[] bytes,
OutputStream os)
throws IOException
OutputStream instance.bytes - byte array with contentos - OutputStream on which content will be writtenIOException - if IO error occursprotected void write(byte[] bytes,
int offset,
int length,
OutputStream os)
throws IOException
OutputStream instance. After draining
the content OutputStream.flush() is invoked.bytes - byte array with contentoffset - starting index of the array from which content will be readlength - number of bytes to be reados - OutputStream on which content will be writtenIOException - if IO error occursCopyright © 2019. All rights reserved.