Class BCPGOutputStream

    • Constructor Detail

      • BCPGOutputStream

        public BCPGOutputStream​(java.io.OutputStream out)
      • BCPGOutputStream

        public BCPGOutputStream​(java.io.OutputStream out,
                                int tag)
                         throws java.io.IOException
        Create a stream representing an old style partial object.
        Parameters:
        tag - the packet tag for the object.
        Throws:
        java.io.IOException
      • BCPGOutputStream

        public BCPGOutputStream​(java.io.OutputStream out,
                                int tag,
                                long length,
                                boolean oldFormat)
                         throws java.io.IOException
        Create a stream representing a general packet.
        Parameters:
        out -
        tag -
        length -
        oldFormat -
        Throws:
        java.io.IOException
      • BCPGOutputStream

        public BCPGOutputStream​(java.io.OutputStream out,
                                int tag,
                                long length)
                         throws java.io.IOException
        Parameters:
        tag -
        length -
        Throws:
        java.io.IOException
      • BCPGOutputStream

        public BCPGOutputStream​(java.io.OutputStream out,
                                int tag,
                                byte[] buffer)
                         throws java.io.IOException
        Create a new style partial input stream buffered into chunks.
        Parameters:
        out - output stream to write to.
        tag - packet tag.
        buffer - size of chunks making up the packet.
        Throws:
        java.io.IOException
    • Method Detail

      • write

        public void write​(int b)
                   throws java.io.IOException
        Specified by:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] bytes,
                          int off,
                          int len)
                   throws java.io.IOException
        Overrides:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • writePacket

        public void writePacket​(ContainedPacket p)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • writeObject

        public void writeObject​(BCPGObject o)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • flush

        public void flush()
                   throws java.io.IOException
        Flush the underlying stream.
        Specified by:
        flush in interface java.io.Flushable
        Overrides:
        flush in class java.io.OutputStream
        Throws:
        java.io.IOException
      • finish

        public void finish()
                    throws java.io.IOException
        Finish writing out the current packet without closing the underlying stream.
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.OutputStream
        Throws:
        java.io.IOException