@Test public void testPrepensNonEmptyMultiplexedInputStream() throws IOException { byte[] entry1 = "entry1".getBytes(); byte[] entry2 = "entry2".getBytes(); byte[] header = "header".getBytes(); ByteArrayOutputStream multiplexedByteArrayOutputStream = new ByteArrayOutputStream(); MultiplexedStreamWriter multiplexedStreamWriter = new MultiplexedStreamWriter(multiplexedByteArrayOutputStream); multiplexedStreamWriter.appendEntry(entry1.length, new ByteArrayInputStream(entry1)); multiplexedStreamWriter.appendEntry(entry2.length, new ByteArrayInputStream(entry2)); multiplexedStreamWriter.appendEndOfFile(); InputStream multiplexedInputStream = multiplexedByteArrayOutputStream.toInputStream(); ByteArrayInputStream headerInputStream = new ByteArrayInputStream(header); PrependedMultiplexedInputStream prependedMultiplexedInputStream = new PrependedMultiplexedInputStream( headerInputStream, header.length, multiplexedInputStream, multiplexedByteArrayOutputStream.size()); MultiplexedStreamReader multiplexedStreamReader = new MultiplexedStreamReader(prependedMultiplexedInputStream); assertThat(multiplexedStreamReader.readNextEntry().get()).hasSameContentAs(new ByteArrayInputStream(header)); assertThat(multiplexedStreamReader.readNextEntry().get()).hasSameContentAs(new ByteArrayInputStream(entry1)); assertThat(multiplexedStreamReader.readNextEntry().get()).hasSameContentAs(new ByteArrayInputStream(entry2)); assertThat(multiplexedStreamReader.readNextEntry()).isEmpty(); }
public long size() { return this.size; }
PrependedMultiplexedInputStream extends ProxyInputStream { public long size() { return this.size; } }
PrependedMultiplexedInputStream extends ProxyInputStream { public long size() { return this.size; } PrependedMultiplexedInputStream(InputStream firstEntryStream, long firstEntrySize,
        InputStream multiplexedInputStream, long multiplexedInputStreamSize); }
PrependedMultiplexedInputStream extends ProxyInputStream { public long size() { return this.size; } PrependedMultiplexedInputStream(InputStream firstEntryStream, long firstEntrySize,
        InputStream multiplexedInputStream, long multiplexedInputStreamSize); long size(); }
PrependedMultiplexedInputStream extends ProxyInputStream { public long size() { return this.size; } PrependedMultiplexedInputStream(InputStream firstEntryStream, long firstEntrySize,
        InputStream multiplexedInputStream, long multiplexedInputStreamSize); long size();  }