了解FileInputStream

import java.io.*;
class FileTest
{
	public static void main(String argvs[]) throws IOException
	{
		FileInputStream fis = new FileInputStream("FileTest.java");
		byte[] buf = new byte[32];

		int read = 0;
		while ( (read = fis.read(buf)) > 0 )
		{
			System.out.println(new String(buf ,0 ,read));
		}

		fis.close();

	}
}

你可能感兴趣的:(JAVA,JAVA)