summaryrefslogtreecommitdiff
path: root/NET/worlds/core/FastDataInput.java
blob: ffdf882c270a116dee11c0858b0971da6e0f3608 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
package NET.worlds.core;

import java.io.DataInput;
import java.io.DataInputStream;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;

public class FastDataInput implements DataInput {
   private DataInputStream dataInputStream;

   public FastDataInput(String fileName) throws IOException {
      nativeInit();
      
      this.dataInputStream = new DataInputStream(new BufferedInputStream(new FileInputStream(fileName)));
   }

   public void close() {
      if (this.dataInputStream != null) {
         try {
            this.dataInputStream.close();
         } catch (IOException e) {
         }
      }
   }

   @Override
   public void readFully(byte[] b) throws IOException {
      this.dataInputStream.readFully(b);
   }

   public static void nativeInit() {
   }

   @Override
   public void readFully(byte[] var1, int var2, int var3) throws IOException {
      this.dataInputStream.readFully(var1, var2, var3);
   }

   @Override
   public int skipBytes(int var1) throws IOException {
      return this.dataInputStream.skipBytes(var1);
   }

   @Override
   public boolean readBoolean() throws IOException {
      return this.dataInputStream.readBoolean();
   }

   @Override
   public byte readByte() throws IOException {
      return this.dataInputStream.readByte();
   }

   @Override
   public int readUnsignedByte() throws IOException {
      return this.dataInputStream.readUnsignedByte();
   }

   @Override
   public short readShort() throws IOException {
      return this.dataInputStream.readShort();
   }

   @Override
   public int readUnsignedShort() throws IOException {
      return this.dataInputStream.readUnsignedShort();
   }

   @Override
   public char readChar() throws IOException {
      return this.dataInputStream.readChar();
   }

   @Override
   public int readInt() throws IOException {
      return this.dataInputStream.readInt();
   }

   @Override
   public long readLong() throws IOException {
      return this.dataInputStream.readLong();
   }

   @Override
   public float readFloat() throws IOException {
      return this.dataInputStream.readFloat();
   }

   @Override
   public double readDouble() throws IOException {
      return this.dataInputStream.readDouble();
   }

   @Override
   public String readLine() throws IOException {
      return this.dataInputStream.readLine();
   }

   @Override
   public String readUTF() throws IOException {
      return this.dataInputStream.readUTF();
   }
}