Code example for StringReader

Methods: close

0
        return sourceReader.read(cbuf, off, len);
    } 
 
    @Override 
    public void close() throws IOException { 
        sourceReader.close();
    } 
 
    protected void build() throws IOException { 
        InputStream jsFileStream = null;
        Parameter implInfoParam = service.getParameter(MashupConstants.SERVICE_JS);
        if (implInfoParam == null) {
            throw new AxisFault("Parameter 'ServiceJS' not specified"); 
        } 
        Object value = implInfoParam.getValue();
        //We are reading the stream from the axis2 parameter 
        jsFileStream = new ByteArrayInputStream((
                (String) service.getParameter(MashupConstants.SERVICE_JS_STREAM).getValue()).getBytes());
        //We are reading the stream from the axis2 parameter 
        try { 
            sourceReader = new StringReader(HostObjectUtil.streamToString(jsFileStream));