// Path: src/main/java/io/openio/sds/common/OioConstants.java
// public static final Charset OIO_CHARSET = Charset.forName("UTF-8");
// 
// Path: src/main/java/io/openio/sds/common/Strings.java
// public static boolean nullOrEmpty(String string) {
//     return null == string || 0 == string.length();
// }


import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.util.HashMap;
import java.util.Map;
import static io.openio.sds.common.OioConstants.OIO_CHARSET;
import static io.openio.sds.common.Strings.nullOrEmpty;
import static java.lang.String.format;

	public String header(String key) {
		return head.headers().get(key.toLowerCase());
	}

	public static class RequestHead {

		private RequestLine requestLine;
		private BufferedReader reader;
		private HashMap<String, String> headers = new HashMap<String, String>();


		private RequestHead(BufferedReader reader) {
			this.reader = reader;
		}

		static RequestHead parse(String head) throws IOException {
			RequestHead h = new RequestHead(new BufferedReader(new StringReader(head)));
			h.parseRequestLine();
			h.parseHeaders();
			return h;
		}

		private void parseRequestLine() throws IOException {
			requestLine = RequestLine.parse(reader.readLine());
		}

		private void parseHeaders() throws IOException {
			String line;
			while (null != (line = reader.readLine())) {
// Path: src/main/java/io/openio/sds/common/OioConstants.java
// public static final Charset OIO_CHARSET = Charset.forName("UTF-8");
// 
// Path: src/main/java/io/openio/sds/common/Strings.java
// public static boolean nullOrEmpty(String string) {
//     return null == string || 0 == string.length();
// }


// Path: src/main/java/io/openio/sds/http/OioHttpRequest.java
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.util.HashMap;
import java.util.Map;
import static io.openio.sds.common.OioConstants.OIO_CHARSET;
import static io.openio.sds.common.Strings.nullOrEmpty;
import static java.lang.String.format;


	public String header(String key) {
		return head.headers().get(key.toLowerCase());
	}

	public static class RequestHead {

		private RequestLine requestLine;
		private BufferedReader reader;
		private HashMap<String, String> headers = new HashMap<String, String>();


		private RequestHead(BufferedReader reader) {
			this.reader = reader;
		}

		static RequestHead parse(String head) throws IOException {
			RequestHead h = new RequestHead(new BufferedReader(new StringReader(head)));
			h.parseRequestLine();
			h.parseHeaders();
			return h;
		}

		private void parseRequestLine() throws IOException {
			requestLine = RequestLine.parse(reader.readLine());
		}

		private void parseHeaders() throws IOException {
			String line;
			while (null != (line = reader.readLine())) {
				if (nullOrEmpty(line))