Skip to content

Commit 5ce09eb

Browse files
committed
removed unnecessary class
fixed test so that not all data is written at once
1 parent 2fe8d88 commit 5ce09eb

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

‎guava/src/main/java/org/baeldung/guava/CountingByteWritter.java‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎guava/src/test/java/org/baeldung/guava/GuavaCountingOutputStreamTest.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ public void givenData_whenCountReachesLimit_thenThrowException() throws Exceptio
1818
byte[] data = new byte[1024];
1919
ByteArrayInputStream in = new ByteArrayInputStream(data);
2020

21-
while (in.read() != -1) {
22-
cos.write(data);
23-
cos.flush();
21+
int b;
22+
while ((b = in.read()) != -1) {
23+
cos.write(b);
2424
if (cos.getCount() >= MAX) {
2525
throw new RuntimeException("Write limit reached");
2626
}

0 commit comments

Comments
 (0)