/** Constructs a bit vector from the file <code>name</code> in Directory
<code>d</code>, as written by the {@link #write} method.
*/
public BitVector(Directory d, String name) throws IOException {
InputStream input = d.openFile(name);
try {
size = input.readInt(); // read size
count = input.readInt(); // read count
bits = new byte[(size >> 3) + 1]; // allocate bits
input.readBytes(bits, 0, bits.length); // read bits
} finally {
input.close();
}
}