Skip to content

Commit 463f8a5

Browse files
committed
Rerolled back from experimental fix, exceeding ByteBuf limit, custom ByteBuf coming soon, String and UUID sending WIP!
1 parent cd36b6b commit 463f8a5

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/de/javasocketapi/core/ReadingByteBuffer.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
package de.javasocketapi.core;
22

3-
import org.boon.primitive.ByteBuf;
4-
3+
import java.nio.ByteBuffer;
54
import java.util.UUID;
65

76
public class ReadingByteBuffer {
8-
private final ByteBuf byteBuffer;
7+
private final ByteBuffer byteBuffer;
98

109
ReadingByteBuffer(final byte... bytes) {
11-
this.byteBuffer = ByteBuf.create(bytes);
10+
this.byteBuffer = ByteBuffer.wrap(bytes);
1211
}
1312

1413
public boolean readBoolean() {
@@ -18,32 +17,32 @@ public boolean readBoolean() {
1817

1918
public byte readByte() {
2019
//read byte
21-
return this.byteBuffer.input().readByte();
20+
return this.byteBuffer.get();
2221
}
2322

2423
public short readShort() {
2524
//read short
26-
return this.byteBuffer.input().readShort();
25+
return this.byteBuffer.getShort();
2726
}
2827

2928
public int readInt() {
3029
//read int
31-
return this.byteBuffer.input().readInt();
30+
return this.byteBuffer.getInt();
3231
}
3332

3433
public long readLong() {
3534
//read long
36-
return this.byteBuffer.input().readLong();
35+
return this.byteBuffer.getLong();
3736
}
3837

3938
public float readFloat() {
4039
//read float
41-
return this.byteBuffer.input().readFloat();
40+
return this.byteBuffer.getFloat();
4241
}
4342

4443
public double readDouble() {
4544
//read double
46-
return this.byteBuffer.input().readDouble();
45+
return this.byteBuffer.getDouble();
4746
}
4847

4948
public char readChar() {

0 commit comments

Comments
 (0)