if (requestBody != null) {
boolean chunked = false; if (requestBody instanceof ByteArrayInputStream) { sb.append("Content-Length: "); sb.append(((ByteArrayInputStream) requestBody).available()); } else if (requestBody != null) {
	private void sendHeader(String method, String path, Map header, InputStream requestBody) throws IOException {		StringBuffer sb = new StringBuffer();        		sb.append(method);		sb.append(' ');        sb.append(path);		sb.append(' ');		sb.append("HTTP/1.1");        sb.append(HttpConnection.CRLF);		sb.append("Host: ");		sb.append(mySVNRepositoryLocation.getHost());		sb.append(HttpConnection.CRLF);        sb.append("Connection: TE");        sb.append(HttpConnection.CRLF);        sb.append("TE: trailers");        sb.append(HttpConnection.CRLF);        if (requestBody != null) {            sb.append("Transfer-Encoding: chunked");        } else {            sb.append("Content-Lenght: 0");        }        sb.append(HttpConnection.CRLF);        sb.append("Accept-Encoding: gzip");        sb.append(HttpConnection.CRLF);        if (header != null) {            if (!header.containsKey("Content-Type")) {                sb.append("Content-Type: text/xml; charset=\"utf-8\"");                sb.append(HttpConnection.CRLF);            }            for(Iterator keys = header.keySet().iterator(); keys.hasNext();) {                Object key = keys.next();                sb.append(key.toString());                sb.append(": ");                sb.append(header.get(key).toString());                sb.append(HttpConnection.CRLF);            }        }        getOutputStream().write(sb.toString().getBytes());        getOutputStream().write(HttpConnection.CRLF_BYTES);        if (requestBody != null) {            byte[] buffer = new byte[2048];            while(true) {                int read = requestBody.read(buffer);                if (read > 0) {                    getOutputStream().write(Integer.toHexString(read).getBytes());                    getOutputStream().write(HttpConnection.CRLF_BYTES);                    getOutputStream().write(buffer, 0, read);                    getOutputStream().write(HttpConnection.CRLF_BYTES);                } else {                    getOutputStream().write('0');                    getOutputStream().write(HttpConnection.CRLF_BYTES);                    getOutputStream().write(HttpConnection.CRLF_BYTES);                    break;                }            }        }        getOutputStream().flush();	}