Class PTCPOutputStream

java.lang.Object
java.io.OutputStream
ecmwf.common.transport.ptcp.psocket.PTCPOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class PTCPOutputStream extends OutputStream
The Class PTCPOutputStream.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor Construct an empty parallel output stream.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes this output stream and releases any system resources associated with this stream.
    boolean
    Check whether we are finished or not.
    void
    Flushes this output stream and forces any buffered output bytes to be written out.
    void
    Wake up.
    void
    write(byte[] b)
    Writes b.length bytes from the specified byte array to this output stream.
    void
    write(byte[] b, int off, int len)
    Write.
    void
    write(int b)
    Writes the specified byte to this output stream.

    Methods inherited from class java.io.OutputStream

    nullOutputStream

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PTCPOutputStream

      public PTCPOutputStream(OutputStream[] streams)
      Default constructor Construct an empty parallel output stream.
      Parameters:
      streams - the streams
  • Method Details

    • close

      public void close() throws IOException
      Closes this output stream and releases any system resources associated with this stream. The general contract of close is that it closes the output stream. A closed stream cannot perform output operations and cannot be reopened.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class OutputStream
      Throws:
      IOException
    • finished

      public boolean finished()
      Check whether we are finished or not.
      Returns:
      true, if successful
    • flush

      public void flush() throws IOException
      Flushes this output stream and forces any buffered output bytes to be written out. The general contract of flush is that calling it is an indication that, if any bytes previously written have been buffered by the implementation of the output stream, such bytes should immediately be written to their intended destination.
      Specified by:
      flush in interface Flushable
      Overrides:
      flush in class OutputStream
      Throws:
      IOException
    • write

      public void write(byte[] b, int off, int len) throws IOException
      Write.
      Overrides:
      write in class OutputStream
      Throws:
      IOException
    • wakeUp

      public void wakeUp()
      Wake up.
    • write

      public void write(int b) throws IOException
      Writes the specified byte to this output stream. The general contract for write is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argument b. The 24 high-order bits of b are ignored. This single byte will travel on command stream
      Specified by:
      write in class OutputStream
      Throws:
      IOException
    • write

      public void write(byte[] b) throws IOException
      Writes b.length bytes from the specified byte array to this output stream. The general contract for write(b) is that it should have exactly the same effect as the call write(b, 0, b.length). This is a parallel write.
      Overrides:
      write in class OutputStream
      Throws:
      IOException