Class LeadPipeOutputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    public class LeadPipeOutputStream
    extends java.io.PipedOutputStream
    LeadPipeOutputStream is a PipedOutputStream that allows the thread reading from the PipedInputStream to die or finish without completing, and does not throw any IOExceptions if this occurs. It can be used when the reader thread does not need to read all of the data, which otherwise would cause an IOException if a writer attempts to write to the PipedOutputStream and the reading thread is not alive. Once the reader thread finishes or dies, then further writes to this LeadPipeOutputStream will return without doing anything.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void write​(byte[] bytes)  
      void write​(byte[] bytes, int i, int i1)  
      void write​(int i)  
      • Methods inherited from class java.io.PipedOutputStream

        close, connect, flush
      • 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 Detail

      • LeadPipeOutputStream

        public LeadPipeOutputStream()
    • Method Detail

      • write

        public void write​(int i)
                   throws java.io.IOException
        Overrides:
        write in class java.io.PipedOutputStream
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] bytes,
                          int i,
                          int i1)
                   throws java.io.IOException
        Overrides:
        write in class java.io.PipedOutputStream
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] bytes)
                   throws java.io.IOException
        Overrides:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException