@Test public void emptyChunk() throws IOException { InputStream is = new DataChunkInputStream(Multi.just(DataChunk.create("foo".getBytes()), DataChunk.create(new byte[0]), DataChunk.create("bar".getBytes()))); int c; StringBuilder sb = new StringBuilder(); while ((c = is.read()) != -1) { sb.append((char) c); } assertThat(sb.toString(), is("foobar")); }
@Override public int read() throws IOException { if (oneByte == null) { oneByte = new byte[1]; } int r = read(oneByte, 0, 1); if (r < 0) { return r; } return oneByte[0] & 0xFF; }
DataChunkInputStream extends InputStream { @Override public int read() throws IOException { if (oneByte == null) { oneByte = new byte[1]; } int r = read(oneByte, 0, 1); if (r < 0) { return r; } return oneByte[0] & 0xFF; } }
DataChunkInputStream extends InputStream { @Override public int read() throws IOException { if (oneByte == null) { oneByte = new byte[1]; } int r = read(oneByte, 0, 1); if (r < 0) { return r; } return oneByte[0] & 0xFF; } DataChunkInputStream(Flow.Publisher<DataChunk> originalPublisher);  DataChunkInputStream(Flow.Publisher<DataChunk> originalPublisher, boolean validate); }
DataChunkInputStream extends InputStream { @Override public int read() throws IOException { if (oneByte == null) { oneByte = new byte[1]; } int r = read(oneByte, 0, 1); if (r < 0) { return r; } return oneByte[0] & 0xFF; } DataChunkInputStream(Flow.Publisher<DataChunk> originalPublisher);  DataChunkInputStream(Flow.Publisher<DataChunk> originalPublisher, boolean validate); @Override void close(); @Override int read(); @Override int read(byte[] buf, int off, int len); }
DataChunkInputStream extends InputStream { @Override public int read() throws IOException { if (oneByte == null) { oneByte = new byte[1]; } int r = read(oneByte, 0, 1); if (r < 0) { return r; } return oneByte[0] & 0xFF; } DataChunkInputStream(Flow.Publisher<DataChunk> originalPublisher);  DataChunkInputStream(Flow.Publisher<DataChunk> originalPublisher, boolean validate); @Override void close(); @Override int read(); @Override int read(byte[] buf, int off, int len);  }