Methods Summary |
---|
public boolean | checkException()
flush();
return errorOccured;
|
public void | close()
flush();
buf = null;
numbuf = null;
try {
if ( f != null )
f.close();
}catch( IOException e ){
errorOccured = true;
recentException = e;
}
super.close();
f = null;
|
public void | flush()
try{
if ( curindex != 0 ){
f.write( buf, 0, curindex );
}
f.flush();
} catch (IOException e ){
errorOccured = true;
recentException = e;
}
curindex = 0;
|
protected void | flushit()
try{
f.write( buf, 0, curindex );
} catch (IOException e ){
errorOccured = true;
recentException = e;
}
curindex = 0;
|
public void | print(char c)
try{
buf[curindex] = (byte)c;
curindex++;
return;
}catch( IndexOutOfBoundsException e ){
flushit();
buf[curindex++] = (byte)c;
}
|
public void | print(char[] s)
int slen = s.length;
for ( int i = 0; i < slen; i++ ){
try{
buf[curindex] = (byte) s[i];
curindex++;
continue;
}catch( IndexOutOfBoundsException e ){
flushit();
buf[curindex++] = (byte) s[i];
}
}
|
public void | print(int i) // for integer conversions
if ( i < 0 ){
if ( i == Integer.MIN_VALUE ){
// special case, not worth bothering with.
print( Integer.toString(Integer.MIN_VALUE));
return;
}
i = -i;
// since even negative numbers hardly happen,
// we don't mind this extra call...
write('-");
}
int n = nnumbuf;
do {
numbuf[--n]= (byte)('0"+(i%10));
i /= 10;
}while( i != 0 );
int nsz = nnumbuf-n;
try{
System.arraycopy( numbuf, n, buf, curindex, nsz );
}catch( IndexOutOfBoundsException e ){
flushit();
System.arraycopy( numbuf, n, buf, curindex, nsz );
}
curindex += nsz;
|
public void | print(long l)
if ( l < 0 ){
if ( l == Long.MIN_VALUE ){
// special case, not worth bothering with.
print( Long.toString(Long.MIN_VALUE));
return;
}
l = -l;
// since even negative numbers hardly happen,
// we don't mind this extra call...
write('-");
}
int n = nnumbuf;
do {
numbuf[--n]= (byte)('0"+(byte)(l%10L));
l /= 10L;
}while( l != 0L );
int nsz = nnumbuf-n;
try{
System.arraycopy( numbuf, n, buf, curindex, nsz-n );
}catch( IndexOutOfBoundsException e ){
flushit();
System.arraycopy( numbuf, n, buf, curindex, nsz-n );
}
curindex += nsz;
|
public void | print(java.lang.Object o)
if ( o == null )
print( "(null)");
else
print( o.toString() );
|
public void | print(java.lang.String s)
int slen = s.length();
try{
s.getBytes( 0, slen, buf, curindex );
}catch( IndexOutOfBoundsException e ){
flushit();
s.getBytes( 0, slen, buf, curindex );
}
curindex += slen;
|
public void | print(boolean b)
if ( b ){
write( truth, 0, 4 );
} else {
write( falsity, 0, 5 );
}
|
public void | println(char c)
try {
buf[curindex] = (byte)c;
curindex++;
}catch( IndexOutOfBoundsException e ){
flushit();
buf[curindex++] = (byte)c;
buf[curindex++] = NL;
return;
}
try{
buf[curindex] = NL;
curindex++;
return;
}catch( IndexOutOfBoundsException e ){
flushit();
buf[curindex++] = NL;
}
|
public void | println(char[] s)
// enough pain to not be worth replicating the above
print( s );
//if ( curindex >= bufsize-1 ) flushit();
// count on print to have left one space at end of buf for us.
try{
buf[curindex] = NL;
curindex++;
}catch( IndexOutOfBoundsException e ){
flushit();
buf[curindex++] = NL;
}
|
public void | println(int i)
// enough pain to not be worth replicating the above
print( i );
try{
buf[curindex] = NL;
curindex++;
}catch( IndexOutOfBoundsException e ){
flushit();
buf[curindex++] = NL;
}
|
public void | println(long l)
// enough pain to not be worth replicating the above
print( l );
try{
buf[curindex] = NL;
curindex++;
}catch( IndexOutOfBoundsException e ){
flushit();
buf[curindex++] = NL;
}
|
public void | println(java.lang.Object o)
if ( o == null )
println( "(null)");
else
println( o.toString() );
|
public void | println(java.lang.String s)
int slen = s.length();
try{
s.getBytes( 0, slen, buf, curindex );
}catch( IndexOutOfBoundsException e ){
flushit();
s.getBytes( 0, slen, buf, curindex );
}
curindex += slen;
try{
buf[curindex] = NL;
curindex++;
}catch( IndexOutOfBoundsException e ){
flushit();
buf[curindex++] = NL;
}
|
public void | println()
try{
buf[curindex] = NL;
curindex++;
}catch( IndexOutOfBoundsException e ){
flushit();
buf[curindex++] = NL;
}
|
public void | println(boolean b)
if ( b ){
write( truth, 0, 5 );
} else {
write( falsity, 0, 6 );
}
|
public void | write(int b)
try {
buf[curindex] = (byte)b;
curindex++;
return;
}catch( IndexOutOfBoundsException e ){
flushit();
buf[curindex++] = (byte)b;
}
|
public void | write(byte[] b, int off, int len)
try{
if (len == 1 ){
buf[curindex] = b[off];
curindex++;
return;
} else {
System.arraycopy( b, off, buf, curindex, len );
curindex += len;
return;
}
}catch( IndexOutOfBoundsException e ){
flushit();
System.arraycopy( b, off, buf, curindex, len );
curindex += len;
}
|