/** * Mark the space as free. * * @param pos the position in bytes * @param length the number of bytes */ public void free(long pos, int length) { int start = getBlock(pos); int blocks = getBlockCount(length); set.clear(start, start + blocks); }
/** * Mark the space as in use. * * @param pos the position in bytes * @param length the number of bytes */ public void markUsed(long pos, int length) { int start = getBlock(pos); int blocks = getBlockCount(length); set.set(start, start + blocks); }
/** * Check whether one of the blocks is in use. * * @param pos the position in bytes * @param length the number of bytes * @return true if a block is in use */ public boolean isUsed(long pos, int length) { int start = getBlock(pos); int blocks = getBlockCount(length); for (int i = start; i < start + blocks; i++) { if (!set.get(i)) { return false; } } return true; }
/** * Check whether one of the blocks is free. * * @param pos the position in bytes * @param length the number of bytes * @return true if a block is free */ public boolean isFree(long pos, int length) { int start = getBlock(pos); int blocks = getBlockCount(length); for (int i = start; i < start + blocks; i++) { if (set.get(i)) { return false; } } return true; }
/** * Mark the space as in use. * * @param pos the position in bytes * @param length the number of bytes */ public void markUsed(long pos, int length) { int start = getBlock(pos); int blocks = getBlockCount(length); set.set(start, start + blocks); }
/** * Mark the space as free. * * @param pos the position in bytes * @param length the number of bytes */ public void free(long pos, int length) { int start = getBlock(pos); int blocks = getBlockCount(length); set.clear(start, start + blocks); }
/** * Mark the space as free. * * @param pos the position in bytes * @param length the number of bytes */ public void free(long pos, int length) { int start = getBlock(pos); int blocks = getBlockCount(length); set.clear(start, start + blocks); }
/** * Mark the space as free. * * @param pos the position in bytes * @param length the number of bytes */ public void free(long pos, int length) { int start = getBlock(pos); int blocks = getBlockCount(length); set.clear(start, start + blocks); }
/** * Mark the space as in use. * * @param pos the position in bytes * @param length the number of bytes */ public void markUsed(long pos, int length) { int start = getBlock(pos); int blocks = getBlockCount(length); set.set(start, start + blocks); }
/** * Mark the space as in use. * * @param pos the position in bytes * @param length the number of bytes */ public void markUsed(long pos, int length) { int start = getBlock(pos); int blocks = getBlockCount(length); set.set(start, start + blocks); }
/** * Check whether one of the blocks is in use. * * @param pos the position in bytes * @param length the number of bytes * @return true if a block is in use */ public boolean isUsed(long pos, int length) { int start = getBlock(pos); int blocks = getBlockCount(length); for (int i = start; i < start + blocks; i++) { if (!set.get(i)) { return false; } } return true; }
/** * Check whether one of the blocks is free. * * @param pos the position in bytes * @param length the number of bytes * @return true if a block is free */ public boolean isFree(long pos, int length) { int start = getBlock(pos); int blocks = getBlockCount(length); for (int i = start; i < start + blocks; i++) { if (set.get(i)) { return false; } } return true; }
/** * Check whether one of the blocks is free. * * @param pos the position in bytes * @param length the number of bytes * @return true if a block is free */ public boolean isFree(long pos, int length) { int start = getBlock(pos); int blocks = getBlockCount(length); for (int i = start; i < start + blocks; i++) { if (set.get(i)) { return false; } } return true; }
/** * Check whether one of the blocks is in use. * * @param pos the position in bytes * @param length the number of bytes * @return true if a block is in use */ public boolean isUsed(long pos, int length) { int start = getBlock(pos); int blocks = getBlockCount(length); for (int i = start; i < start + blocks; i++) { if (!set.get(i)) { return false; } } return true; }
/** * Check whether one of the blocks is free. * * @param pos the position in bytes * @param length the number of bytes * @return true if a block is free */ public boolean isFree(long pos, int length) { int start = getBlock(pos); int blocks = getBlockCount(length); for (int i = start; i < start + blocks; i++) { if (set.get(i)) { return false; } } return true; }
/** * Check whether one of the blocks is in use. * * @param pos the position in bytes * @param length the number of bytes * @return true if a block is in use */ public boolean isUsed(long pos, int length) { int start = getBlock(pos); int blocks = getBlockCount(length); for (int i = start; i < start + blocks; i++) { if (!set.get(i)) { return false; } } return true; }