Home | History | Annotate | Download | only in util

Lines Matching refs:offset

54      * @throws IndexOutOfBoundsException if {@code offset} or {@code size} is negative.
56 public RandomAccessFileDataSource(RandomAccessFile file, long offset, long size) {
57 if (offset < 0) {
58 throw new IndexOutOfBoundsException("offset: " + size);
64 mOffset = offset;
82 public RandomAccessFileDataSource slice(long offset, long size) {
84 checkChunkValid(offset, size, sourceSize);
85 if ((offset == 0) && (size == sourceSize)) {
89 return new RandomAccessFileDataSource(mFile, mOffset + offset, size);
93 public void feed(long offset, long size, DataSink sink) throws IOException {
95 checkChunkValid(offset, size, sourceSize);
100 long chunkOffsetInFile = mOffset + offset;
116 public void copyTo(long offset, int size, ByteBuffer dest) throws IOException {
118 checkChunkValid(offset, size, sourceSize);
126 long offsetInFile = mOffset + offset;
149 public ByteBuffer getByteBuffer(long offset, int size) throws IOException {
154 copyTo(offset, size, result);
159 private static void checkChunkValid(long offset, long size, long sourceSize) {
160 if (offset < 0) {
161 throw new IndexOutOfBoundsException("offset: " + offset);
166 if (offset > sourceSize) {
168 "offset (" + offset + ") > source size (" + sourceSize + ")");
170 long endOffset = offset + size;
171 if (endOffset < offset) {
173 "offset (" + offset + ") + size (" + size + ") overflow");
177 "offset (" + offset + ") + size (" + size