public void testResetOut() throws IOException {
CachedOutputStream cos = new CachedOutputStream();
String result = initTestData(16);
cos.write(result.getBytes());
ByteArrayOutputStream out = new ByteArrayOutputStream();
cos.resetOut(out, true);
String test = out.toString();
assertEquals("The test stream content isn't same ", test , result);
}
String initTestData(int packetSize) {