private void getResponse() throws IOException {
		// 获取HTTP响应头
		byte[] b = new byte[4096];
		int off, val, endcode = 0;
		for (off = 0; off < 4096 && endcode != 0x0d0a0d0a; off++) {
			if((val = instream.read()) == -1)
				break;
			b[off] = (byte) val;
			endcode <<= 8;
			endcode |= val;
			// System.out.printf("[%4d, 0x%08x] val = %d\n", off, int32, val);
		}
		//System.out.println("off = " + off);
		if (endcode != 0x0d0a0d0a) // 0x0d0a0d0a: "\r\n\r\n"
			throw new IOException("HTTP response header not found.");

		// 解析响应头
		response = new String(b, 0, off);
		String[] header = response.split("\r\n");
		if (header.length < 1)
			throw new IOException("Illegal response header.");

		StatusLine = header[0];
		parseStatusLine();

		String[] pair;
		for (String line : header) {
			pair = line.split(": ");
			if (pair.length == 2)
				map.put(pair[0], pair[1]);
		}

		try {
			ContentLength = Long.parseLong(map.get("Content-Length"));
		} catch (NumberFormatException e) {
			ContentLength = -1;
		}
	}