// Path: src/main/java/ca/rbon/iostream/wrap/DataOutputOf.java
// public class DataOutputOf<T> extends DataOutputStream implements WrapperOf<T> {
// 
//     final Resource<T> closer;
// 
//     /**
//      * <p>
//      * Constructor for DataOutputOf.
//      * </p>
//      *
//      * @param cl a {@link ca.rbon.iostream.resource.Resource} object.
//      * @param os a {@link java.io.OutputStream} object.
//      */
//     public DataOutputOf(Resource<T> cl, OutputStream os) {
//         super(os);
//         closer = cl;
//     }
// 
//     /** {@inheritDoc} */
//     @Override
//     public T getInner() throws IOException {
//         return closer.getResource();
//     }
// 
//     /**
//      * Use the DataOutputStream inline and return the inner resource.
//      * @param operation The operation to apply.
//      * @return The inner resource.
//      * @throws IOException if the passed in closure throws
//      */
//     public T with(BiConsumer<DataOutputOf<T>, T> operation) throws IOException {
//         operation.accept(this, getInner());
//         return getInner();
//     }
// }


import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import ca.rbon.iostream.wrap.DataOutputOf;
        var bytes = IO.bytes().printWriter();
        // ...
        bytes.close();
        byte[] myPrecious = bytes.getInner();
    }

    public void jdkResult() throws IOException {
        // JDK
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        Writer writer = new PrintWriter(byteArrayOutputStream);
        // ...
        writer.close();
        byte[] myPrecious = byteArrayOutputStream.toByteArray();
    }

    public void files() throws IOException {
        var out = IO.file("noooes.txt").outputStream();

        try (PrintWriter w = IO.file("mouha.txt").printWriter()) {
            w.append("haha");
        }

        IO.file("doum.zip").zipInputStream("UTF-8");
        IO.file("dam.txt", true).bufferedWriter();

        DataOutputOf<File> tmpout = IO.tempFile().dataOutputStream();
        tmpout.write(42);
        String tmpFilename = tmpout.getInner().getAbsolutePath();
    }

// Path: src/main/java/ca/rbon/iostream/wrap/DataOutputOf.java
// public class DataOutputOf<T> extends DataOutputStream implements WrapperOf<T> {
// 
//     final Resource<T> closer;
// 
//     /**
//      * <p>
//      * Constructor for DataOutputOf.
//      * </p>
//      *
//      * @param cl a {@link ca.rbon.iostream.resource.Resource} object.
//      * @param os a {@link java.io.OutputStream} object.
//      */
//     public DataOutputOf(Resource<T> cl, OutputStream os) {
//         super(os);
//         closer = cl;
//     }
// 
//     /** {@inheritDoc} */
//     @Override
//     public T getInner() throws IOException {
//         return closer.getResource();
//     }
// 
//     /**
//      * Use the DataOutputStream inline and return the inner resource.
//      * @param operation The operation to apply.
//      * @return The inner resource.
//      * @throws IOException if the passed in closure throws
//      */
//     public T with(BiConsumer<DataOutputOf<T>, T> operation) throws IOException {
//         operation.accept(this, getInner());
//         return getInner();
//     }
// }


// Path: src/test/java/ca/rbon/iostream/Samples.java
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import ca.rbon.iostream.wrap.DataOutputOf;

        var bytes = IO.bytes().printWriter();
        // ...
        bytes.close();
        byte[] myPrecious = bytes.getInner();
    }

    public void jdkResult() throws IOException {
        // JDK
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        Writer writer = new PrintWriter(byteArrayOutputStream);
        // ...
        writer.close();
        byte[] myPrecious = byteArrayOutputStream.toByteArray();
    }

    public void files() throws IOException {
        var out = IO.file("noooes.txt").outputStream();

        try (PrintWriter w = IO.file("mouha.txt").printWriter()) {
            w.append("haha");
        }

        IO.file("doum.zip").zipInputStream("UTF-8");
        IO.file("dam.txt", true).bufferedWriter();

        DataOutputOf<File> tmpout = IO.tempFile().dataOutputStream();
        tmpout.write(42);
        String tmpFilename = tmpout.getInner().getAbsolutePath();
    }

    public void strings() throws IOException {