@Override public FileChannel truncate(long newSize) throws IOException { init(); if (newSize > size) { return this; } if (newSize < 0) { throw new IllegalArgumentException("newSize: " + newSize); } int offset = (int) (newSize & BLOCK_SIZE_MASK); if (offset > 0) { base.truncate(newSize + HEADER_LENGTH + BLOCK_SIZE); } else { base.truncate(newSize + HEADER_LENGTH); } this.size = newSize; pos = Math.min(pos, size); return this; }
return 0; init(); len = (int) Math.min(len, size - position); if (position >= size) {
@Override public int write(ByteBuffer src, long position) throws IOException { init(); int len = src.remaining(); if ((position & BLOCK_SIZE_MASK) != 0 ||
@Override public int write(ByteBuffer src, long position) throws IOException { init(); int len = src.remaining(); if ((position & BLOCK_SIZE_MASK) != 0 ||
@Override public int write(ByteBuffer src, long position) throws IOException { init(); int len = src.remaining(); if ((position & BLOCK_SIZE_MASK) != 0 ||
return 0; init(); len = (int) Math.min(len, size - position); if (position >= size) {
return 0; init(); len = (int) Math.min(len, size - position); if (position >= size) {
@Override public FileChannel truncate(long newSize) throws IOException { init(); if (newSize > size) { return this; } if (newSize < 0) { throw new IllegalArgumentException("newSize: " + newSize); } int offset = (int) (newSize & BLOCK_SIZE_MASK); if (offset > 0) { base.truncate(newSize + HEADER_LENGTH + BLOCK_SIZE); } else { base.truncate(newSize + HEADER_LENGTH); } this.size = newSize; pos = Math.min(pos, size); return this; }
@Override public FileChannel truncate(long newSize) throws IOException { init(); if (newSize > size) { return this; } if (newSize < 0) { throw new IllegalArgumentException("newSize: " + newSize); } int offset = (int) (newSize & BLOCK_SIZE_MASK); if (offset > 0) { base.truncate(newSize + HEADER_LENGTH + BLOCK_SIZE); } else { base.truncate(newSize + HEADER_LENGTH); } this.size = newSize; pos = Math.min(pos, size); return this; }
@Override public long size() throws IOException { init(); return size; }
@Override public long size() throws IOException { init(); return size; }
@Override public long size() throws IOException { init(); return size; }