📄 slog_string.java
字号:
import java.io.*;public class SLOG_String implements Serializable{ private String str; public SLOG_String() { str = new String(); } public SLOG_String( byte [] bytes ) { str = new String( bytes ); } public SLOG_String( char [] values ) { str = new String( values ); } public int ReadFromRandomFileAt( RandomAccessFile file_stm, long fileloc ) throws IOException { file_stm.seek( fileloc ); return( ReadFromRandomFile( file_stm ) ); } public int ReadFromRandomFile( RandomAccessFile file_stm ) throws IOException { int Nchar = file_stm.readInt(); byte bytes[] = new byte[ Nchar ]; file_stm.readFully( bytes ); str = new String( bytes ); return Nchar; } public int WriteToRandomFile( RandomAccessFile file_stm ) throws IOException { int Nchar = str.length(); file_stm.writeInt( Nchar ); file_stm.writeBytes( str ); return Nchar; } public String toString() { return str; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -