private static final boolean copyHeader(String name,String fromReq,StringBuilder buf){
  int start=fromReq.indexOf(name);
  if (start != -1) {
    int end=fromReq.indexOf("\r\n",start);
    if (end != -1) {
      buf.append(fromReq.subSequence(start - 2,end));
      return true;
    }
  }
  return false;
}

private static final boolean copyHeader ( String name , String fromReq , StringBuilder buf ) { int start = fromReq . indexOf ( name ) ; if ( start != - 1 ) { int end = fromReq . indexOf ( "\r\n" , start ) ; if ( end != - 1 ) { buf . append ( fromReq . subSequence ( start - 2 , end ) ) ; return true ; } } return false ; }
copies a header from a request
