public static byte[] stripContinueFromRequests(byte[] input){
  byte[] result=input;
  while (true) {
    String initialPart=new String(result,0,Math.min(MAX_HEADER_SIZE,result.length));
    Matcher m=CONTINUE_PATTERN.matcher(initialPart);
    if (m.find()) {
      int stringIndex=m.start();
      final int stringLength=m.end() - m.start();
      result=new byte[input.length - stringLength];
      System.arraycopy(input,0,result,0,stringIndex);
      System.arraycopy(input,stringIndex + stringLength,result,stringIndex,input.length - (stringIndex + stringLength));
    }
 else {
      break;
    }
  }
  return result;
}

public static byte [ ] stripContinueFromRequests ( byte [ ] input ) { byte [ ] result = input ; while ( true ) { String initialPart = new String ( result , 0 , Math . min ( MAX_HEADER_SIZE , result . length ) ) ; Matcher m = CONTINUE_PATTERN . matcher ( initialPart ) ; if ( m . find ( ) ) { int stringIndex = m . start ( ) ; final int stringLength = m . end ( ) - m . start ( ) ; result = new byte [ input . length - stringLength ] ; System . arraycopy ( input , 0 , result , 0 , stringIndex ) ; System . arraycopy ( input , stringIndex + stringLength , result , stringIndex , input . length - ( stringIndex + stringLength ) ) ; } else { break ; } } return result ; }
removes provisional " http / 1 . 1 100 continue " server responses from the request stream . these responses will appear in the request stream ( rather than the response stream ) given the assumption from the http splitting library that a http conversion contains a single request followed by a single response .
