## gate.util
Class ObjectWriter

    java.lang.Object
      |
      +--java.lang.Thread
            |
            +--gate.util.ObjectWriter

All Implemented Interfaces:
  Runnable

public class ObjectWriter
extends Thread

Writes an object to an PipedOutputStream wich can be connected to a PipedInputStream. Before writting the object it also writes it in a buffer and finds out its size so it can be reported via getSize method. All read/writes occur in separate threads to avoid a deadlock.

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

Constructor Summary
`ObjectWriter(Object obj)`

Method Summary
`InputStream` `getInputStream()` Returns a PipedInputStream from which the object given as parameter for the constructor can be read.
`int` `getSize()` Obtains the object size.
`void` `run()` Writes all the buffers to the output stream

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

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

Constructor Detail

### ObjectWriter

    public ObjectWriter(Object obj)
                 throws IOException

Method Detail

### getInputStream

    public InputStream getInputStream()

  Returns a PipedInputStream from which the object given as parameter for the constructor can be read.
  Returns:
    a PipedInputStream connected to PipedOutputStream which writes the object which this ObjectWriter was built for.

### getSize

    public int getSize()

  Obtains the object size.
  Returns:
    the size of the object recieved as parameter for the constructor.

### run

    public void run()

  Writes all the buffers to the output stream
  Overrides:
    `run` in class `Thread`