private ByteBuffer sendResponse( String status, String mime, Properties header, String response )
	{
		
			if ( status == null )
				throw new Error( "sendResponse(): Status can't be null." );

			StringBuffer buffer = new StringBuffer();
			buffer.append("HTTP/1.0 " + status + " \r\n");
			if ( mime != null )
				buffer.append("Content-Type: " + mime + "\r\n");

			SimpleDateFormat gmtFrmt = new java.text.SimpleDateFormat( "E, d MMM yyyy HH:mm:ss 'GMT'", Locale.CHINA);
			gmtFrmt.setTimeZone(TimeZone.getTimeZone("GMT"));
			
			if ( header == null || header.getProperty( "Date" ) == null )
				buffer.append( "Date: " + gmtFrmt.format( new Date()) + "\r\n");

			if ( header != null )
			{
				Enumeration e = header.keys();
				while ( e.hasMoreElements())
				{
					String key = (String)e.nextElement();
					String value = header.getProperty( key );
					buffer.append( key + ": " + value + "\r\n");
				}
			}

			buffer.append("\r\n");

			if ( response != null )
			{
				buffer.append(response);
			}
			
			try {
				byte[] bytes = buffer.toString().getBytes("UTF-8");
				ByteBuffer byteBuffer = ByteBuffer.wrap(bytes);
				return byteBuffer;
			} catch (UnsupportedEncodingException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				return null;
			}
	}