removed unnecessary class
fixed test so that not all data is written at once
This commit is contained in:
parent
2fe8d8810d
commit
5ce09eb2eb
|
@ -1,5 +0,0 @@
|
|||
package org.baeldung.guava;
|
||||
|
||||
public class CountingByteWritter {
|
||||
|
||||
}
|
|
@ -18,9 +18,9 @@ public class GuavaCountingOutputStreamTest {
|
|||
byte[] data = new byte[1024];
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(data);
|
||||
|
||||
while (in.read() != -1) {
|
||||
cos.write(data);
|
||||
cos.flush();
|
||||
int b;
|
||||
while ((b = in.read()) != -1) {
|
||||
cos.write(b);
|
||||
if (cos.getCount() >= MAX) {
|
||||
throw new RuntimeException("Write limit reached");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue