slog_string.java
来自「MPICH是MPI的重要研究,提供了一系列的接口函数,为并行计算的实现提供了编程」· Java 代码 · 共 55 行
JAVA
55 行
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 + =
减小字号Ctrl + -
显示快捷键?