Package java.io

Examples of java.io.StringBufferInputStream


            LogicalMessage msg = messagecontext.getMessage();
            Source payload = msg.getPayload();
            String st = getStringFromSourcePayload(payload);
            String txt = String.valueOf(Integer.valueOf(getFirstArg(st)) * 2);
            st = replaceFirstArg(st, txt);
            msg.setPayload(new StreamSource(new StringBufferInputStream(st)));
        }
        return true;
    }
View Full Code Here


            }
            LogicalMessage msg = messagecontext.getMessage();
            String st = getStringFromSourcePayload(msg.getPayload());
            String txt = String.valueOf(Integer.valueOf(getFirstArg(st)) - 1);
            st = replaceFirstArg(st, txt);
            msg.setPayload(new StreamSource(new StringBufferInputStream(st)));
        }
        else {
            LogicalMessage msg = messagecontext.getMessage();
           
            Source s = msg.getPayload();
View Full Code Here

    DocumentBuilder documentBuilder;

    logger.debug("IN");

    if (!(data instanceof InputStream)) {
      inputDataStream = new StringBufferInputStream((String)data);
    }
    else{
      inputDataStream = (InputStream)data;
    }
View Full Code Here

    OutputStream out=null;
    File tmpFile=null;
    try {               
      tmpFile = File.createTempFile(fileName, "." + outputType, dir);
      out = new FileOutputStream(tmpFile);
      StringBufferInputStream sbis=new StringBufferInputStream(templateStr);
      logger.debug("compiling report");
      JasperReport report  = JasperCompileManager.compileReport(sbis);
      //report.setProperty("", )
      logger.debug("filling report");
      JasperPrint jasperPrint = JasperFillManager.fillReport(report, parameters, datasource);
View Full Code Here

    // Should not be autocreated
    ExtendedNode node = (ExtendedNode) rootNode.addNode("deep", "nt:unstructured");

    // create BLOB property
    node.setProperty("test", new StringBufferInputStream("testValue1"));
    node.setProperty("test", new StringBufferInputStream("testValue2"));
    session.save();

    AuditHistory history = service.getHistory(node);
    assertEquals(ExtendedEventType.PROPERTY_CHANGED, history.getAuditRecords()
                                                            .get(2)
View Full Code Here

    DocumentBuilderFactory factory = new DocumentBuilderFactoryImpl();
    factory.setNamespaceAware(true);
    factory.setValidating(false);
       
    try {
      StringBufferInputStream stream = new StringBufferInputStream(writer.getBuffer().toString());
      DocumentBuilder builder = factory.newDocumentBuilder();
      InputStreamReader reader = new InputStreamReader(stream, "UTF8");
      InputSource source = new InputSource(reader);
      source.setEncoding("UTF8");
      Document document = builder.parse(source);
View Full Code Here

    @Test
    public void xpathFunctionW3C() throws Exception
    {
        org.w3c.dom.Document document = DocumentBuilderFactory.newInstance()
            .newDocumentBuilder()
            .parse(new StringBufferInputStream("<root foo=\"bar\"/>"));
        MuleMessage message = new DefaultMuleMessage(document, muleContext);
        assertEquals(document.getFirstChild().getAttributes().getNamedItem("foo"),
            evaluate("xpath('/root/@foo')", message));
    }
View Full Code Here

    @Test
    public void xpathFunctionW3CText() throws Exception
    {
        org.w3c.dom.Document document = DocumentBuilderFactory.newInstance()
            .newDocumentBuilder()
            .parse(new StringBufferInputStream("<root foo=\"bar\"/>"));
        MuleMessage message = new DefaultMuleMessage(document, muleContext);
        assertEquals("bar", evaluate("xpath('/root/@foo').textContent", message));
    }
View Full Code Here

        args.add(arg);
    }
    args.add("-");
    args.addAll(extra);
    new DataFileWriteTool().run(
        new StringBufferInputStream(jsonData),
        new PrintStream(out), // stdout
        null, // stderr
        args);
    out.close();
    fout.close();
View Full Code Here

  public void testFailureOnWritingPartialJSONValues() throws Exception {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintStream out = new PrintStream(baos);
    try {
      new DataFileWriteTool().run(
          new StringBufferInputStream("{"),
          new PrintStream(out), // stdout
          null, // stderr         
          Arrays.asList("-schema", "{ \"type\":\"record\", \"fields\":" +
                        "[{\"name\":\"foo\", \"type\":\"string\"}], " +
                        "\"name\":\"boring\" }", "-"));
View Full Code Here

TOP

Related Classes of java.io.StringBufferInputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.