📄 util.java
字号:
package com.tmri.sourcesafe;
// Util.java
import java.io.*;
public class Util
{
// 把文件读入byte数组
static public byte[] readFile( String filename ) throws IOException {
File file = new File( filename );
long len = file.length();
byte data[] = new byte[(int)len];
FileInputStream fin = new FileInputStream( file );
int r = fin.read( data );
if (r != len)
throw new IOException( "Only read "+r+" of "+len+" for "+file );
fin.close();
return data;
}
// 把byte数组写出到文件
static public void writeFile( String filename, byte data[] )
throws IOException {
FileOutputStream fout = new FileOutputStream( filename );
fout.write( data );
fout.close();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -