public static RawHeaders fromMultimap(Map<String,List<String>> map,boolean response) throws IOException {
  if (!response)   throw new UnsupportedOperationException();
  RawHeaders result=new RawHeaders();
  for (  Entry<String,List<String>> entry : map.entrySet()) {
    String fieldName=entry.getKey();
    List<String> values=entry.getValue();
    if (fieldName != null) {
      for (      String value : values) {
        result.addLenient(fieldName,value);
      }
    }
 else     if (!values.isEmpty()) {
      result.setStatusLine(values.get(values.size() - 1));
    }
  }
  return result;
}

public static RawHeaders fromMultimap ( Map < String , List < String > > map , boolean response ) throws IOException { if ( ! response ) throw new UnsupportedOperationException ( ) ; RawHeaders result = new RawHeaders ( ) ; for ( Entry < String , List < String > > entry : map . entrySet ( ) ) { String fieldName = entry . getKey ( ) ; List < String > values = entry . getValue ( ) ; if ( fieldName != null ) { for ( String value : values ) { result . addLenient ( fieldName , value ) ; } } else if ( ! values . isEmpty ( ) ) { result . setStatusLine ( values . get ( values . size ( ) - 1 ) ) ; } } return result ; }
creates a new instance from the given map of fields to values . if present , the null field ' s last element will be used to set the status line .
