Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.utils.io
Class DataTransferThread

    java.lang.Object
      java.lang.Thread
          oracle.ifs.utils.io.DataTransferThread

All Implemented Interfaces:
  java.lang.Runnable

    public class DataTransferThread

extends java.lang.Thread

The `DataTransferThread.java` class Thread for transfering from input stream to output stream in a thread.

Nested Class Summary

Nested classes/interfaces inherited from class java.lang.Thread
`java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler`

Field Summary
`protected java.io.IOException` | `m_exception`
`protected java.io.InputStream` | `m_in`
`protected boolean` | `m_isBinaryTransfer`
`protected java.io.OutputStream` | `m_out`

Fields inherited from class java.lang.Thread
`MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

Constructor Summary
`DataTransferThread()`
`DataTransferThread(java.io.InputStream in, java.io.OutputStream out, boolean isBinaryTransfer)` Creates a DataTransferThread

Method Summary
`protected byte[]` | `getByteBuffer()` gets a bytes buffer
`int` | `getBytesTransfered()`
`protected int` | `getDesiredBufferSize()` determines the size of the byte buffer
`java.io.IOException` | `getException()` Returns an Exception if one exists usage -- call this method after the thread has run to get an Exception if one occured
`void` | `reset(java.io.InputStream in, java.io.OutputStream out, boolean isBinaryTransfer)`
`void` | `run()` Transfers the content from InputStream to OutputStream
`void` | `throwException()` Throws an Exception if one exists usage -- call this method after the thread has run to have exception thrown
`protected int` | `transferAsciiData(java.io.InputStream in, java.io.OutputStream out)` Transfer content from an inputstream to an outputstream, processing newlines.
`protected int` | `transferBinaryData(java.io.InputStream in, java.io.OutputStream out)` Transfer content from an inputstream to an outputstream, with no newline processing
`protected int` | `transferData(java.io.InputStream in, java.io.OutputStream out, boolean isBinaryTransfer)` Transfers content from inputstream to outputstream

Methods inherited from class java.lang.Thread
`activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### m_in

    protected java.io.InputStream m_in

### m_out

    protected java.io.OutputStream m_out

### m_isBinaryTransfer

    protected boolean m_isBinaryTransfer

### m_exception

    protected java.io.IOException m_exception

Constructor Detail

### DataTransferThread

    public DataTransferThread()

### DataTransferThread

    public DataTransferThread(java.io.InputStream in,
                              java.io.OutputStream out,
                              boolean isBinaryTransfer)

  Creates a DataTransferThread

  Parameters:
    `isBinaryTransfer` - boolean to transfer in binary or ascii

Method Detail

### reset

    public void reset(java.io.InputStream in,
                      java.io.OutputStream out,
                      boolean isBinaryTransfer)

### run

    public void run()

  Description copied from class: `DataTransferThread`
  Transfers the content from InputStream to OutputStream

  Specified by:
    `run` in interface `java.lang.Runnable`
  Overrides:
    `run` in class `java.lang.Thread`

### throwException

    public void throwException()
                        throws java.io.IOException

  Description copied from class: `DataTransferThread`
  Throws an Exception if one exists usage -- call this method after the thread has run to have exception thrown

  Throws:
    `java.io.IOException`

### getException

    public java.io.IOException getException()

  Description copied from class: `DataTransferThread`
  Returns an Exception if one exists usage -- call this method after the thread has run to get an Exception if one occured

### getBytesTransfered

    public int getBytesTransfered()

### transferData

    protected int transferData(java.io.InputStream in,
                               java.io.OutputStream out,
                               boolean isBinaryTransfer)
                        throws java.io.IOException

  Description copied from class: `DataTransferThread`
  Transfers content from inputstream to outputstream

  Parameters:
    `in` - the input stream
    `out` - the output stream
    `isBinaryTransfer` - if true binary transfer, if false ascii transfer with bytes put on wire according to ftp rfc (no
  Returns:
    int the number of bytes transfered
  Throws:
    `java.io.IOException`

### transferBinaryData

    protected final int transferBinaryData(java.io.InputStream in,
                                           java.io.OutputStream out)
                                    throws java.io.IOException

  Description copied from class: `DataTransferThread`
  Transfer content from an inputstream to an outputstream, with no newline processing

  Returns:
    int the number of bytes transfered
  Throws:
    `java.io.IOException`

### transferAsciiData

    protected final int transferAsciiData(java.io.InputStream in,
                                          java.io.OutputStream out)
                                   throws java.io.IOException

  Description copied from class: `DataTransferThread`
  Transfer content from an inputstream to an outputstream, processing newlines. Warning this method does not work for 2 byte characters.

  Returns:
    int the number of bytes transfered
  Throws:
    `java.io.IOException`

### getDesiredBufferSize

    protected int getDesiredBufferSize()

  Description copied from class: `DataTransferThread`
  determines the size of the byte buffer

### getByteBuffer

    protected byte[] getByteBuffer()

  Description copied from class: `DataTransferThread`
  gets a bytes buffer

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD