This project has retired. For details please refer to its
Attic page.
ExtendedByteArrayDataInput xref
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.giraph.utils;
19
20 import java.io.ByteArrayInputStream;
21 import java.io.DataInput;
22 import java.io.DataInputStream;
23 import java.io.IOException;
24
25
26
27
28 public class ExtendedByteArrayDataInput extends ByteArrayInputStream
29 implements ExtendedDataInput {
30
31 private final DataInput dataInput;
32
33
34
35
36
37 public ExtendedByteArrayDataInput(byte[] buf) {
38 super(buf);
39 dataInput = new DataInputStream(this);
40 }
41
42
43
44
45
46
47
48
49 public ExtendedByteArrayDataInput(byte[] buf, int offset, int length) {
50 super(buf, offset, length);
51 dataInput = new DataInputStream(this);
52 }
53
54 @Override
55 public int getPos() {
56 return pos;
57 }
58
59 @Override
60 public boolean endOfInput() {
61 return available() == 0;
62 }
63
64 @Override
65 public void readFully(byte[] b) throws IOException {
66 dataInput.readFully(b);
67 }
68
69 @Override
70 public void readFully(byte[] b, int off, int len) throws IOException {
71 dataInput.readFully(b, off, len);
72 }
73
74 @Override
75 public int skipBytes(int n) throws IOException {
76 return dataInput.skipBytes(n);
77 }
78
79 @Override
80 public boolean readBoolean() throws IOException {
81 return dataInput.readBoolean();
82 }
83
84 @Override
85 public byte readByte() throws IOException {
86 return dataInput.readByte();
87 }
88
89 @Override
90 public int readUnsignedByte() throws IOException {
91 return dataInput.readUnsignedByte();
92 }
93
94 @Override
95 public short readShort() throws IOException {
96 return dataInput.readShort();
97 }
98
99 @Override
100 public int readUnsignedShort() throws IOException {
101 return dataInput.readUnsignedShort();
102 }
103
104 @Override
105 public char readChar() throws IOException {
106 return dataInput.readChar();
107 }
108
109 @Override
110 public int readInt() throws IOException {
111 return dataInput.readInt();
112 }
113
114 @Override
115 public long readLong() throws IOException {
116 return dataInput.readLong();
117 }
118
119 @Override
120 public float readFloat() throws IOException {
121 return dataInput.readFloat();
122 }
123
124 @Override
125 public double readDouble() throws IOException {
126 return dataInput.readDouble();
127 }
128
129 @Override
130 public String readLine() throws IOException {
131 return dataInput.readLine();
132 }
133
134 @Override
135 public String readUTF() throws IOException {
136 return dataInput.readUTF();
137 }
138 }