6 import java.io.IOException;
7 import java.io.InputStream;
8 import java.io.OutputStream;
16 * OutputStreamへデータを書き込む
18 public static void writeInt(OutputStream os, int i) throws IOException {
20 os.write((i >> 0) & 0xff);
21 os.write((i >> 8) & 0xff);
22 os.write((i >> 16) & 0xff);
23 os.write((i >> 24) & 0xff);
25 public static int readInt(InputStream is) throws IOException{
26 int num = (is.read() & 0xff) +
27 (is.read() & 0xff) << 8+
28 (is.read() & 0xff) << 16+
29 (is.read() & 0xff) << 24;