src/main/java/js/http/encoder/JsonArgumentsReader.java
@Override
	public Object[] read(HttpServletRequest httpRequest, Type[] formalParameters) throws IOException, IllegalArgumentException {
		JsonReader reader = new JsonReader(httpRequest.getInputStream(), expectedStartSequence(formalParameters));
		try {
			return json.parse(reader, formalParameters);
		} catch (JsonException e) {
			throw new IllegalArgumentException(e.getMessage());
		} finally {
			reader.close();
		}
	}
@Override
	public Object[] read(HttpServletRequest httpRequest, Type[] formalParameters) throws IOException, IllegalArgumentException {
		JsonReader reader = new JsonReader(httpRequest.getInputStream(), expectedStartSequence(formalParameters));
		try {
			return json.parse(reader, formalParameters);
		} catch (JsonException e) {
			throw new IllegalArgumentException(e.getMessage());
		} finally {
			reader.close();
		}
	}
@ Override public Object [ ] read ( HttpServletRequest httpRequest , Type [ ] formalParameters ) throws IOException , IllegalArgumentException { JsonReader reader = new JsonReader ( httpRequest . getInputStream ( ) , expectedStartSequence ( formalParameters ) ) ; try { return json . parse ( reader , formalParameters ) ; } catch ( JsonException e ) { throw new IllegalArgumentException ( e . getMessage ( ) ) ; } finally { reader . close ( ) ; } }
Uses JSON deserializer to parse method invocation arguments accordingly formal parameters list.

@param httpRequest HTTP request,
@param formalParameters formal parameter types.
@return arguments array.
@throws IOException if reading from request input stream fails.
@throws IllegalArgumentException if arguments from HTTP request cannot be parsed.
@throws JsonException if JSON parsing fails due to invalid stream format.
Uses JSON deserializer to parse method invocation arguments accordingly formal parameters list .