📄 basicoutput.java
字号:
//******************* start of BasicOutput.java
package basicIO;
import java.io.*;
public class BasicOutput {
public BasicOutput() {
output = new PrintWriter( System.out, true );
}
public BasicOutput( String f ) throws IOException {
output =
new PrintWriter( new FileOutputStream( f ), true );
diskFile = true;
}
public BasicOutput( String f, boolean a ) throws IOException {
if ( a ) //*** append mode?
output =
new PrintWriter( new FileOutputStream( f, true ), true );
else
output =
new PrintWriter( new FileOutputStream( f ), true );
diskFile = true;
}
public void flush() throws IOException {
output.flush();
}
public void close() throws IOException {
if ( diskFile && output != null )
output.close();
}
public void put( String s ) {
output.print( s );
output.flush();
}
public void putln( String s ) {
output.println( s );
}
public void put( byte b ) {
output.print( b );
output.flush();
}
public void putln( byte b ) {
output.println( b );
}
public void put( int i ) {
output.print( i );
output.flush();
}
public void putln( int i ) {
output.println( i );
}
public void put( double d ) {
output.print( d );
output.flush();
}
public void putln( double d ) {
output.println( d );
}
public void put( char c ) {
output.print( c );
output.flush();
}
public void putln( char c ) {
output.println( c );
}
public void putln() {
output.println();
}
protected PrintWriter output;
private boolean diskFile;
}
//******************* end of BasicOutput.java
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -