// Path: src/se/vidstige/jadb/AdbFilterInputStream.java
// public class AdbFilterInputStream extends FilterInputStream {
//     public AdbFilterInputStream(InputStream inputStream) {
//         super(inputStream);
//     }
// 
//     @Override
//     public int read() throws IOException {
//         int b1 = in.read();
//         if (b1 == 0x0d) {
//             in.mark(1);
//             int b2 = in.read();
//             if (b2 == 0x0a) {
//                 return b2;
//             }
//             in.reset();
//         }
//         return b1;
//     }
// 
//     @Override
//     public int read(byte[] buffer, int offset, int length) throws IOException {
//         int n = 0;
//         for (int i = 0; i < length; i++) {
//             int b = read();
//             if (b == -1) return n == 0 ? -1 : n;
//             buffer[offset + n] = (byte) b;
//             n++;
// 
//             // Return as soon as no more data is available (and at least one byte was read)
//             if (in.available() <= 0) {
//                 return n;
//             }
//         }
//         return n;
//     }
// 
//     @Override
//     public int read(byte[] buffer) throws IOException {
//         return read(buffer, 0, buffer.length);
//     }
// }
// 
// Path: src/se/vidstige/jadb/Stream.java
// public class Stream {
//     private Stream() {
//         throw new IllegalStateException("Utility class");
//     }
// 
//     public static void copy(InputStream in, OutputStream out) throws IOException {
//         byte[] buffer = new byte[1024 * 10];
//         int len;
//         while ((len = in.read(buffer)) != -1) {
//             out.write(buffer, 0, len);
//         }
//     }
// 
//     public static String readAll(InputStream input, Charset charset) throws IOException {
//         ByteArrayOutputStream tmp = new ByteArrayOutputStream();
//         Stream.copy(input, tmp);
//         return new String(tmp.toByteArray(), charset);
//     }
// }


import org.junit.Assert;
import org.junit.Test;
import se.vidstige.jadb.AdbFilterInputStream;
import se.vidstige.jadb.Stream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
package se.vidstige.jadb.test.unit;



public class AdbInputStreamFixture {

    private byte[] passthrough(byte[] input) throws IOException {
        ByteArrayInputStream inputStream = new ByteArrayInputStream(input);
// Path: src/se/vidstige/jadb/AdbFilterInputStream.java
// public class AdbFilterInputStream extends FilterInputStream {
//     public AdbFilterInputStream(InputStream inputStream) {
//         super(inputStream);
//     }
// 
//     @Override
//     public int read() throws IOException {
//         int b1 = in.read();
//         if (b1 == 0x0d) {
//             in.mark(1);
//             int b2 = in.read();
//             if (b2 == 0x0a) {
//                 return b2;
//             }
//             in.reset();
//         }
//         return b1;
//     }
// 
//     @Override
//     public int read(byte[] buffer, int offset, int length) throws IOException {
//         int n = 0;
//         for (int i = 0; i < length; i++) {
//             int b = read();
//             if (b == -1) return n == 0 ? -1 : n;
//             buffer[offset + n] = (byte) b;
//             n++;
// 
//             // Return as soon as no more data is available (and at least one byte was read)
//             if (in.available() <= 0) {
//                 return n;
//             }
//         }
//         return n;
//     }
// 
//     @Override
//     public int read(byte[] buffer) throws IOException {
//         return read(buffer, 0, buffer.length);
//     }
// }
// 
// Path: src/se/vidstige/jadb/Stream.java
// public class Stream {
//     private Stream() {
//         throw new IllegalStateException("Utility class");
//     }
// 
//     public static void copy(InputStream in, OutputStream out) throws IOException {
//         byte[] buffer = new byte[1024 * 10];
//         int len;
//         while ((len = in.read(buffer)) != -1) {
//             out.write(buffer, 0, len);
//         }
//     }
// 
//     public static String readAll(InputStream input, Charset charset) throws IOException {
//         ByteArrayOutputStream tmp = new ByteArrayOutputStream();
//         Stream.copy(input, tmp);
//         return new String(tmp.toByteArray(), charset);
//     }
// }


// Path: test/se/vidstige/jadb/test/unit/AdbInputStreamFixture.java
import org.junit.Assert;
import org.junit.Test;
import se.vidstige.jadb.AdbFilterInputStream;
import se.vidstige.jadb.Stream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;

package se.vidstige.jadb.test.unit;



public class AdbInputStreamFixture {

    private byte[] passthrough(byte[] input) throws IOException {
        ByteArrayInputStream inputStream = new ByteArrayInputStream(input);
        InputStream sut = new AdbFilterInputStream(inputStream);