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];
|
byte[] data = new byte[1024];
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(data);
|
ByteArrayInputStream in = new ByteArrayInputStream(data);
|
||||||
|
|
||||||
while (in.read() != -1) {
|
int b;
|
||||||
cos.write(data);
|
while ((b = in.read()) != -1) {
|
||||||
cos.flush();
|
cos.write(b);
|
||||||
if (cos.getCount() >= MAX) {
|
if (cos.getCount() >= MAX) {
|
||||||
throw new RuntimeException("Write limit reached");
|
throw new RuntimeException("Write limit reached");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user