mirror of
https://github.com/corda/corda.git
synced 2025-04-10 12:50:37 +00:00
Merge branch 'master' of ssh://git.ecovate.com/avian
This commit is contained in:
commit
76f57fc931
@ -56,7 +56,7 @@ public abstract class InputStream {
|
||||
}
|
||||
|
||||
public void reset() throws IOException {
|
||||
// ignore
|
||||
throw new IOException("mark/reset not supported");
|
||||
}
|
||||
|
||||
public boolean markSupported() {
|
||||
|
@ -56,6 +56,8 @@ public class RandomAccessFile {
|
||||
throw new ArrayIndexOutOfBoundsException();
|
||||
|
||||
copy(peer, position, buffer, offset, length);
|
||||
|
||||
position += length;
|
||||
}
|
||||
|
||||
private static native void copy(long peer, long position, byte[] buffer,
|
||||
|
@ -15,45 +15,50 @@ public abstract class Buffer {
|
||||
protected int position;
|
||||
protected int limit;
|
||||
|
||||
public int limit() {
|
||||
public final int limit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
public int remaining() {
|
||||
public final int remaining() {
|
||||
return limit-position;
|
||||
}
|
||||
|
||||
public int position() {
|
||||
public final int position() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public int capacity() {
|
||||
public final int capacity() {
|
||||
return capacity;
|
||||
}
|
||||
|
||||
public Buffer limit(int newLimit) {
|
||||
public final Buffer limit(int newLimit) {
|
||||
limit = newLimit;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Buffer position(int newPosition) {
|
||||
public final Buffer position(int newPosition) {
|
||||
position = newPosition;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean hasRemaining() {
|
||||
public final boolean hasRemaining() {
|
||||
return remaining() > 0;
|
||||
}
|
||||
|
||||
public Buffer clear() {
|
||||
public final Buffer clear() {
|
||||
position = 0;
|
||||
limit = capacity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Buffer flip() {
|
||||
public final Buffer flip() {
|
||||
limit = position;
|
||||
position = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
public final Buffer rewind() {
|
||||
position = 0;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user