PPT Slide
System.out.write(errorMsg);
System.out.write(successMsg);
private static byte[] successMsg = "\rMessage successfully read in readIntoBuffer".getBytes(),
errorMsg = "\rMaximum message length exceeded in readIntoBuffer".getBytes();
private static IOException lengthExceeded = new IOException();
private byte[] buffer = new byte[5000];
private MyByteArrayOutputStream byteStream = new MyByteArrayOutputStream();
private static byte[] successMsg = "\rMessage successfully read in readIntoBuffer".getBytes(),
errorMsg = "\rMaximum message length exceeded in readIntoBuffer".getBytes();
private static IOException lengthExceeded = new IOException();
public MyByteArrayOutputStream readIntoBuffer(InputStream in) {
bytesRead = in.read(buffer);
byteStream.write(buffer, 0, bytesRead);
System.out.write(successMsg);
} catch (IOException e) {
System.out.write(errorMsg);