public FetchedData handle(ContentHandlerArgs args,MessageQueue mq){
  FetchedData result=doHandle(args,mq);
  if (result == null) {
    ByteArrayOutputStream intermediateResponse=new ByteArrayOutputStream();
    Pair<ContentType,String> contentParams=getReturnedContentParams(args);
    OutputStreamWriter writer=new OutputStreamWriter(intermediateResponse,Charsets.UTF_8);
    try {
      renderAsJSON((String)null,(String)null,contentParams.b,mq,writer,false);
    }
 catch (    IOException e) {
      throw new SomethingWidgyHappenedError(e);
    }
    result=FetchedData.fromBytes(intermediateResponse.toByteArray(),contentParams.a.mimeType,"UTF-8",InputSource.UNKNOWN);
  }
  return result;
}

public FetchedData handle ( ContentHandlerArgs args , MessageQueue mq ) { FetchedData result = doHandle ( args , mq ) ; if ( result == null ) { ByteArrayOutputStream intermediateResponse = new ByteArrayOutputStream ( ) ; Pair < ContentType , String > contentParams = getReturnedContentParams ( args ) ; OutputStreamWriter writer = new OutputStreamWriter ( intermediateResponse , Charsets . UTF_8 ) ; try { renderAsJSON ( ( String ) null , ( String ) null , contentParams . b , mq , writer , false ) ; } catch ( IOException e ) { throw new SomethingWidgyHappenedError ( e ) ; } result = FetchedData . fromBytes ( intermediateResponse . toByteArray ( ) , contentParams . a . mimeType , "UTF-8" , InputSource . UNKNOWN ) ; } return result ; }
main entry point for the fetching proxy .
