RedissonInputStream.seek method added

pull/1204/head
Nikita 7 years ago
parent 2ed066355c
commit 547573e7ee

@ -66,11 +66,19 @@ public class RedissonBinaryStream extends RedissonBucket<byte[]> implements RBin
}
class RedissonInputStream extends InputStream {
public class RedissonInputStream extends InputStream {
private int index;
private int mark;
public void seek(long pos) {
if (pos >= 0 && pos < size()) {
index = (int) pos;
} else {
throw new IllegalStateException("size is " + size() + " but pos is " + pos);
}
}
@Override
public long skip(long n) throws IOException {
long k = size() - index;

Loading…
Cancel
Save