Home | History | Annotate | Download | only in util

Lines Matching refs:offset

55     public ByteBuffer getByteBuffer(long offset, int size) {
56 checkChunkValid(offset, size);
58 // checkChunkValid ensures that it's OK to cast offset to int.
59 int chunkPosition = (int) offset;
78 public void copyTo(long offset, int size, ByteBuffer dest) {
79 dest.put(getByteBuffer(offset, size));
83 public void feed(long offset, long size, DataSink sink) throws IOException {
87 sink.consume(getByteBuffer(offset, (int) size));
91 public ByteBufferDataSource slice(long offset, long size) {
92 if ((offset == 0) && (size == mSize)) {
99 getByteBuffer(offset, (int) size),
104 private void checkChunkValid(long offset, long size) {
105 if (offset < 0) {
106 throw new IndexOutOfBoundsException("offset: " + offset);
111 if (offset > mSize) {
113 "offset (" + offset + ") > source size (" + mSize + ")");
115 long endOffset = offset + size;
116 if (endOffset < offset) {
118 "offset (" + offset + ") + size (" + size + ") overflow");
122 "offset (" + offset + ") + size (" + size + ") > source size (" + mSize +")");