code: private static Charset getCharset(MediaType mediaType)
  	{
  		String charsetName = mediaType.getParameters().get(MediaType.CHARSET_PARAMETER);
  		Charset charset;
  		
  		if (charsetName != null)
  		{
  			charset = Charset.forName(charsetName);
  		}
  		else
  		{
  			charset = DEFAULT_CHARSET;
  		}
  		
  		return charset;
  	}
docs: ----------------------------------------------------------------------------------------------------------------