public class FileContentSource extends AbstractContentSource
ContentSource with File as underlying byte source.BUFFER_SIZE| Constructor and Description |
|---|
FileContentSource(File file) |
FileContentSource(String path) |
| Modifier and Type | Method and Description |
|---|---|
long |
getLength() |
long |
writeTo(OutputStream outStream)
Write this content to a
OutputStream instance. |
long |
writeTo(Socket socket)
Write this content on to a network socket
|
long |
writeTo(SocketChannel channel)
Write this content on to a
SocketChannel |
public FileContentSource(String path)
public FileContentSource(File file)
public long getLength()
public long writeTo(Socket socket) throws IOException
ContentSourcesocket - socketIOException - IOExceptionpublic long writeTo(SocketChannel channel) throws IOException
ContentSourceSocketChannelchannel - channelIOException - IOExceptionpublic long writeTo(OutputStream outStream) throws IOException
ContentSourceOutputStream instance.outStream - streamIOException - IOExceptionCopyright © 2019. All rights reserved.