projects
/
jpf-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated Buffer and Matcher Classes (#171)
[jpf-core.git]
/
src
/
classes
/
java
/
nio
/
ByteBuffer.java
diff --git
a/src/classes/java/nio/ByteBuffer.java
b/src/classes/java/nio/ByteBuffer.java
index e0c99a79c5f8f91d74433227605c2c30ba13de91..fa99a65f68ed44c7e2bc9763ea370a71cac6cd17 100644
(file)
--- a/
src/classes/java/nio/ByteBuffer.java
+++ b/
src/classes/java/nio/ByteBuffer.java
@@
-19,12
+19,13
@@
package java.nio;
public class ByteBuffer extends Buffer {
byte[] array;
public class ByteBuffer extends Buffer {
byte[] array;
+ int offset;
public static ByteBuffer allocate(int i) {
if (i < 0) {
throw new IllegalArgumentException();
}
public static ByteBuffer allocate(int i) {
if (i < 0) {
throw new IllegalArgumentException();
}
- ByteBuffer newBuffer = new ByteBuffer(
i
);
+ ByteBuffer newBuffer = new ByteBuffer(
-1, 0, i, i, new byte[i], 0
);
return newBuffer;
}
return newBuffer;
}
@@
-32,14
+33,18
@@
public class ByteBuffer extends Buffer {
return allocate(capacity);
}
return allocate(capacity);
}
- protected ByteBuffer(int i) {
- capacity = i;
- this.clear();
- array = new byte[i];
+ ByteBuffer(int mark, int pos, int lim, int cap, byte[] hb, int offset) {
+ super(mark, pos, lim, cap);
+ this.array = hb;
+ this.offset = offset;
+ }
+
+ ByteBuffer(int mark, int pos, int lim, int cap) {
+ this(mark, pos, lim, cap, null, 0);
}
public ByteBuffer duplicate() {
}
public ByteBuffer duplicate() {
- ByteBuffer copy = new ByteBuffer(
capacity
);
+ ByteBuffer copy = new ByteBuffer(
-1, 0, capacity, capacity, new byte[capacity], 0
);
copy.array = array;
return copy;
}
copy.array = array;
return copy;
}
@@
-50,7
+55,7
@@
public class ByteBuffer extends Buffer {
public ByteBuffer slice() {
int remaining = limit - position;
public ByteBuffer slice() {
int remaining = limit - position;
- ByteBuffer copy = new ByteBuffer(
remaining
);
+ ByteBuffer copy = new ByteBuffer(
-1, 0, remaining, remaining, new byte[remaining], 0
);
copy.array = array;
return copy;
}
copy.array = array;
return copy;
}
@@
-280,7
+285,7
@@
public class ByteBuffer extends Buffer {
}
public static ByteBuffer wrap(byte[] outMess) {
}
public static ByteBuffer wrap(byte[] outMess) {
- ByteBuffer byteBuffer = new ByteBuffer(
outMess.length
);
+ ByteBuffer byteBuffer = new ByteBuffer(
-1, 0, outMess.length, outMess.length, new byte[outMess.length], 0
);
byteBuffer.clear();
System.arraycopy(outMess, 0 , byteBuffer.array, 0, outMess.length);
return byteBuffer;
byteBuffer.clear();
System.arraycopy(outMess, 0 , byteBuffer.array, 0, outMess.length);
return byteBuffer;