static void realRead(InputStream is, byte[] buffer, int bytesToRead) throws IOException {
		int read = 0, value;
		while (read < bytesToRead) {
			value = is.read();
			if (value < 0) {
				throw new RuntimeException("EOF!");
			}

			buffer[read++] = (byte) value;
			read += is.read(buffer, read, bytesToRead - read);
		}
	}