public class DataTransferHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
protected InputStream |
m_in |
protected boolean |
m_isBinaryTransfer |
protected OutputStream |
m_out |
| Constructor and Description |
|---|
DataTransferHelper() |
DataTransferHelper(InputStream in,
OutputStream out,
boolean isBinaryTransfer)
Creates a DataTransferHelper
|
| Modifier and Type | Method and Description |
|---|---|
protected byte[] |
getByteBuffer()
gets a bytes buffer
|
protected int |
getDesiredBufferSize()
determines the size of the byte buffer
|
void |
reset(InputStream in,
OutputStream out,
boolean isBinaryTransfer) |
int |
transfer()
Transfers the content from InputStream to OutputStream
|
protected int |
transferAsciiData(InputStream in,
OutputStream out)
Transfer content from an inputstream to an outputstream,
processing newlines.
|
protected int |
transferBinaryData(InputStream in,
OutputStream out)
Transfer content from an inputstream to an outputstream,
with no newline processing
|
protected int |
transferData(InputStream in,
OutputStream out,
boolean isBinaryTransfer)
Transfers content from inputstream to outputstream
|
protected InputStream m_in
protected OutputStream m_out
protected boolean m_isBinaryTransfer
public DataTransferHelper()
public DataTransferHelper(InputStream in, OutputStream out, boolean isBinaryTransfer)
isBinaryTransfer - boolean to transfer in binary or asciipublic void reset(InputStream in, OutputStream out, boolean isBinaryTransfer)
public int transfer()
throws IOException
IOExceptionprotected int transferData(InputStream in, OutputStream out, boolean isBinaryTransfer) throws IOException
in - the input streamout - the output streamisBinaryTransfer - if true binary transfer, if false ascii transfer with bytes put on wire according to ftp rfc (noIOExceptionprotected final int transferBinaryData(InputStream in, OutputStream out) throws IOException
IOExceptionprotected final int transferAsciiData(InputStream in, OutputStream out) throws IOException
IOExceptionprotected int getDesiredBufferSize()
protected byte[] getByteBuffer()
Copyright © 2025. All rights reserved.