ps.close();
byte[] buf = baos.toByteArray();
byte[] buf1 = new byte[buf.length];
for (int i=0; i < buf.length; i++) buf1[i] = buf[i];
BufferedInputStreamMicro bism = new BufferedInputStreamMicro(new ByteArrayInputStream(buf));
BufferedReader br = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(buf1)));
while (true) {
String referenceLine = br.readLine(); // of the normal reader
if (referenceLine == null)
break;
String lineToCheck = bism.readLine(); // must be the same as the corresponding reference since we expect same behaviour
if (lineToCheck == null)
assertTrue("the line to be checked is unexpectedly null", false);
assertEquals("wrong content", referenceLine, lineToCheck);
}
String lineToCheck = bism.readLine(); // must be the same as the corresponding reference since we expect same behaviour
assertTrue("The line to check must also be null", lineToCheck == null);
log.info("testReadLine successfully completed");
}
catch (Exception ex) {