Methods Summary |
---|
public void | close()
if (throwExceptionOnNextUse) {
throw new IOException("Exception thrown for testing purpose.");
}
|
public void | flush()
if (throwExceptionOnNextUse) {
throw new IOException("Exception thrown for testing purpose.");
}
|
public byte[] | toByteArray()
byte[] toReturn = new byte[pos];
System.arraycopy(buf, 0, toReturn, 0, pos);
return toReturn;
|
public java.lang.String | toString()
return new String(buf, 0, pos);
|
public void | write(int oneByte)
if (throwExceptionOnNextUse) {
throw new IOException("Exception thrown for testing purpose.");
}
if (pos < size) {
buf[pos] = (byte)(oneByte & 255);
pos++;
} else {
throw new IOException("Internal buffer overflow.");
}
|