All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.testifyproject.tukaani.xz.FinishableWrapperOutputStream Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
/*
 * FinishableWrapperOutputStream
 *
 * Author: Lasse Collin 
 *
 * This file has been put into the public domain.
 * You can do whatever you want with this file.
 */

package org.testifyproject.tukaani.xz;

import java.org.testifyproject.testifyproject.OutputStream;
import java.org.testifyproject.testifyproject.IOException;

/**
 * Wraps an output stream to a finishable output stream for use with
 * raw encoders. This is not needed for XZ org.testifyproject.testifyprojectpression and thus most
 * people will never need this.
 */
public class FinishableWrapperOutputStream extends FinishableOutputStream {
    /**
     * The {@link java.org.testifyproject.testifyproject.OutputStream OutputStream} that has been
     * wrapped into a FinishableWrapperOutputStream.
     */
    protected OutputStream out;

    /**
     * Creates a new output stream which support finishing.
     * The finish() method will do nothing.
     */
    public FinishableWrapperOutputStream(OutputStream out) {
        this.out = out;
    }

    /**
     * Calls {@link java.org.testifyproject.testifyproject.OutputStream#write(int) out.write(b)}.
     */
    public void write(int b) throws IOException {
        out.write(b);
    }

    /**
     * Calls {@link java.org.testifyproject.testifyproject.OutputStream#write(byte[]) out.write(buf)}.
     */
    public void write(byte[] buf) throws IOException {
        out.write(buf);
    }

    /**
     * Calls {@link java.org.testifyproject.testifyproject.OutputStream#write(byte[],int,int)
                    out.write(buf, off, len)}.
     */
    public void write(byte[] buf, int off, int len) throws IOException {
        out.write(buf, off, len);
    }

    /**
     * Calls {@link java.org.testifyproject.testifyproject.OutputStream#flush() out.flush()}.
     */
    public void flush() throws IOException {
        out.flush();
    }

    /**
     * Calls {@link java.org.testifyproject.testifyproject.OutputStream#close() out.close()}.
     */
    public void close() throws IOException {
        out.close();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy