rendered paste bodypublic class OversGraphDataAction extends BaseActoinSupport implements MatchAware{ /** The Constant serialVersionUID. */ private static final long serialVersionUID = 6140362965701423918L; /** The logger. */ private static Logger logger = Logger.getLogger( OversGraphDataAction.class ); /** The match id. */ private String matchId = null; /** The graph code. */ private int graphCode ; /** The resolution. */ private String resolution; /* (non-Javadoc) * @see com.tcm.autumn.framework.action.BaseActoinSupport#doExecute() */// @Override// @Action( value = "/oversgraphdata", results =// {} ) public void doExecute() throws IOException { if (graphCode != 0) { byte[] graphData = LiveMatchManager.getInningsGraphData(matchId, graphCode, resolution); logger.debug("graphData-->"+ ((graphData != null) ? graphData.length : graphData) + " For code " + graphCode + " res " + resolution); if (graphData != null) { write(1); write(graphData); } else { write(0); write(AlertType.INFO.getValue()); write(Constants.INFO); write(getPropertyMessage("com.tcm.autumn.servlets.LiveServlet.graph.unavailable")); } } }abstract public class BaseActoinSupport extends ActionSupport implements ServletResponseAware, ServletRequestAware, ResponseWriter { /** The Constant serialVersionUID. */ private static final long serialVersionUID = 8379660468509074284L; /** The logger. */ private static Logger logger = Logger.getLogger(BaseActoinSupport.class); /** The out stream. */ private OutputStream outStream; /** The response. */ private HttpServletResponse response; /** The request. */ private HttpServletRequest request;public class CommunicationUtil { /** Return the individual Ads String value. */ private ResponseBuffer buffer = new ResponseBuffer(); /** The out stream. */ ByteArrayOutputStream outStream = new ByteArrayOutputStream(); /** * Write string on stream. * * @param sText the s text * @throws IOException Signals that an I/O exception has occurred. */ public void write(String sText)throws IOException { CommunicationUtil.writeString(outStream, sText); buffer.append(sText); } /** * Write. * * @param nNumber the n number * @throws IOException Signals that an I/O exception has occurred. */ public void write(int nNumber) throws IOException { CommunicationUtil.writeInt(outStream, nNumber); buffer.append(nNumber); } /** * Write. * * @param imageBytes the image bytes * @throws IOException Signals that an I/O exception has occurred. */ public void write(byte[] imageBytes) throws IOException { writeInt(outStream, imageBytes.length); outStream.write(imageBytes); buffer.append(imageBytes);