从RandomAccessFile读取4个字节并将它们连接成字符串
//package com.nowjava; import java.io.IOException; import java.io.RandomAccessFile;//来 自 N o w J a v a . c o m public class Main { /** * Reads 4 bytes and concatenates them into a String. * This pattern is used for ID's of various kinds. */ public static String read4Chars(RandomAccessFile raf) throws IOException { StringBuffer sbuf = new StringBuffer(4); for (int i = 0; i < 4; i++) {