public boolean[] readBooleanArray() throws IOException
	{
		final int size = this.readInt();
		final int byteCount = ceilDiv(size, 8);

		final boolean[] bools = new boolean[size];
		final byte[] data = new byte[byteCount];

		this.in.read(data);
		for (int boolIndex = 0, byteIndex = 0, bitIndex = 7; boolIndex < size; boolIndex++)
		{
			int l = 1 << bitIndex;
			bools[boolIndex] = (data[byteIndex] & l) != 0;
			--bitIndex;

			if (bitIndex < 0)
			{
				byteIndex++;
				bitIndex = 7;
			}
		}
		return bools;
	}