⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readbytes.java

📁 一个十分好的java基础学习的课件
💻 JAVA
字号:
import java.io.*;

public class ReadBytes
{   public static void main(String[ ] args) 
    {   try 
        {   FileInputStream file = new FileInputStream("class.dat");
            boolean eof = false;
            int count = 0;
            while (!eof) 
           {    int input = file.read( );
                System.out.print(input + " ");
                if (input == -1)
                    eof = true;
                else
                    count++;
            }
            file.close( );
            System.out.println("\nBytes read: " + count);
        } 
        catch (IOException e) 
        {
            System.out.println("Error -- " + e.toString( ));
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -