()
| 365 | } |
| 366 | |
| 367 | @Test |
| 368 | public void testEagerStream() throws IOException { |
| 369 | ProxyStream ps = new ProxyStream(new ByteArrayInputStream(DATA)); |
| 370 | BrotliInputStream reader = new BrotliInputStream(ps, 1); |
| 371 | byte[] buffer = new byte[1]; |
| 372 | reader.read(buffer); |
| 373 | reader.close(); |
| 374 | int normalReadBytes = ps.readBytes; |
| 375 | |
| 376 | ps = new ProxyStream(new ByteArrayInputStream(DATA)); |
| 377 | reader = new BrotliInputStream(ps, 1); |
| 378 | reader.enableEagerOutput(); |
| 379 | reader.read(buffer); |
| 380 | reader.close(); |
| 381 | int eagerReadBytes = ps.readBytes; |
| 382 | |
| 383 | // Did not continue decoding - suspended as soon as enough data was decoded. |
| 384 | assertTrue(eagerReadBytes < normalReadBytes); |
| 385 | } |
| 386 | } |
nothing calls this directly
no test coverage detected