code: @SuppressWarnings("resource")
  	private static String parseGwtRpcMethodName(InputStream stream, String charEncoding) {
  		//commented out code uses GWT-user library for a more 'proper' approach.
  		//GWT-user library approach is more future-proof, but requires more dependency management.
  		//				RPCRequest decodeRequest = RPC.decodeRequest(readLine);
  		//				gwtmethodname = decodeRequest.getMethod().getName();
  
  		try {
  			final Scanner scanner;
  			if (charEncoding == null) {
  				scanner = new Scanner(stream);
  			} else {
  				scanner = new Scanner(stream, charEncoding);
  			}
  			scanner.useDelimiter(GWT_RPC_SEPARATOR_CHAR_PATTERN); //AbstractSerializationStream.RPC_SEPARATOR_CHAR
  
  			//AbstractSerializationStreamReader.prepareToRead(...)
  			scanner.next(); //stream version number
  			scanner.next(); //flags
  
  			//ServerSerializationStreamReader.deserializeStringTable()
  			scanner.next(); //type name count
  
  			//ServerSerializationStreamReader.preapreToRead(...)
  			scanner.next(); //module base URL
  			scanner.next(); //strong name
  
  			//RPC.decodeRequest(...)
  			scanner.next(); //service interface name
  			return "." + scanner.next(); //service method name
  
  			//note we don't close the scanner because we don't want to close the underlying stream
  		} catch (final NoSuchElementException e) {
  			LOG.debug("Unable to parse GWT-RPC request", e);
  
  			//code above is best-effort - we were unable to parse GWT payload so
  			//treat as a normal HTTP request
  			return null;
  		}
  	}
docs: Try to parse GWT-RPC method name from request body stream.  Does not close the stream.
  
  @param stream GWT-RPC request body stream @nonnull
  @param charEncoding character encoding of stream, or null for platform default @null
  @return GWT-RPC method name, or null if unable to parse @null