readandshow.java
来自「Here is the Java files with 14 different」· Java 代码 · 共 29 行
JAVA
29 行
// $Id$import java.io.*;import java.nio.*;import java.nio.channels.*;public class ReadAndShow{ static public void main( String args[] ) throws Exception { FileInputStream fin = new FileInputStream( "readandshow.txt" ); FileChannel fc = fin.getChannel(); ByteBuffer buffer = ByteBuffer.allocate( 1024 ); fc.read( buffer ); buffer.flip(); int i=0; while (buffer.remaining()>0) { byte b = buffer.get(); System.out.println( "Character "+i+": "+((char)b) ); i++; } fin.close(); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?