private byte[] readNBytes(int n) throws IOException {
		if (n <= 0) {
			throw new IllegalArgumentException();
		}
		byte buf[] = new byte[n];

		int readcount = 0;
		int lastreadcount;
		while (readcount < n) {
			lastreadcount = this.is.read(buf, readcount, n - readcount);
			if (lastreadcount == -1) {
				throw new EOFException(
						String.format(
								"Could only get %d of %d requested bytes",
								readcount, n));
			}
			readcount += lastreadcount;

		}

		return buf;
	}