Class TeeOutputStream

  • All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable

    public class TeeOutputStreamextends ProxyOutputStream
    Classic splitter of OutputStream. Named after the unix 'tee' command. It allows a stream to be branched off so there are now two streams.
    $Id: 1686503 2015-06-19 21:32:13Z sebb $
    • Field Detail

      • branch

        protected OutputStream branch
        the second OutputStream to write to
    • Constructor Detail

      • TeeOutputStream

        public TeeOutputStream(OutputStream out,               OutputStream branch)
        Constructs a TeeOutputStream.
        out - the main OutputStream
        branch - the second OutputStream
    • Method Detail

      • write

        public void write(byte[] b,         int off,         int len)           throws IOException
        Write the specified bytes to both streams.
        write in class ProxyOutputStream
        b - the bytes to write
        off - The start offset
        len - The number of bytes to write
        IOException - if an I/O error occurs
      • close

        public void close()           throws IOException
        Closes both output streams. If closing the main output stream throws an exception, attempt to close the branch output stream. If closing the main and branch output streams both throw exceptions, which exceptions is thrown by this method is currently unspecified and subject to change.
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface AutoCloseable
        close in class ProxyOutputStream
        IOException - if an I/O error occurs

Copyright © 2002–2016 The Apache Software Foundation. All rights reserved.

Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14