System.out.println("buffer = " + buffer);
}
public void testReadFully() {
byte[] name="Bela".getBytes();
ByteArrayDataInputStream in=new ByteArrayDataInputStream(name);
byte[] buf=new byte[10];
int read=in.read(buf, 0, buf.length);
assert read == 4;
assert in.position() == 4;
in.position(0);
try {
in.readFully(buf, 0, buf.length);
assert false : "readFully() should have thrown an EOFException";
}
catch(Exception eof_ex) {
System.out.println("got exception as expected: " + eof_ex);
assert eof_ex instanceof EOFException;