Package java.io

Examples of java.io.StringBufferInputStream


   * @throws ParserConfigurationException
   * @throws SAXException
   * @throws IOException
   */
  public Document loadInlineDocument(String xml) throws ParserConfigurationException, SAXException, IOException {
    return loadDocument(new StringBufferInputStream(xml));
  }
View Full Code Here


                                content.append(lineSeparator);
                            }
                        }

                        return flavor.equals(DataFlavor.stringFlavor) ? (Object)content.toString()
                                                                      : new StringBufferInputStream(content.toString());
                    }

                    throw new UnsupportedFlavorException(flavor);
                }
View Full Code Here

  {
    try
    {
      // Create it
      currentProject.create(currentProject.getWorkspace().loadProjectDescription(
          new StringBufferInputStream(contents)), null);                   
     
      //Open the project so we can create it, squelch the exceptions, because
      //some will be generated for missing files we are about to dowload
      try
        {
View Full Code Here

                "    <servlet-mapping>\n" +
                "        <servlet-name>MSSReader</servlet-name>\n" +
                "        <url-pattern>/mssreader/*</url-pattern>\n" +
                "    </servlet-mapping>\n" +
                "</web-app>\n";
        return new StringBufferInputStream(webXML);
    }
View Full Code Here

    X509Certificate cert = null;

    log.debug("for " + user_proxy_str);

    InputStream bis = null;
    bis = new BufferedInputStream(new StringBufferInputStream(user_proxy_str));
    CertificateFactory cf = CertificateFactory.getInstance("X.509");
    cert = (X509Certificate)cf.generateCertificate(bis);
    bis.close();
    return cert;
  }
View Full Code Here

        Object obj = getObject(columnIndex);
        if (obj == null) {
            return null;
        }
        if (obj instanceof byte[]) {
            return new StringBufferInputStream(new String((byte[]) obj));
        }

        if (obj instanceof String) {
            return new StringBufferInputStream((String) obj);
        }

        if (obj instanceof char[]) {
            return new StringBufferInputStream(new String((char[]) obj));
        }

        // rowset.10=Data Type Mismatch
        throw new SQLException(Messages.getString("rowset.10")); //$NON-NLS-1$
    }
View Full Code Here

                log.append("   Match using CharacterArrayCharacterIterator\n");
                if (!tryMatchUsingCI(new CharacterArrayCharacterIterator(toMatch.toCharArray(), 0, toMatch.length())))
                    return;

                log.append("   Match using StreamCharacterIterator\n");
                if (!tryMatchUsingCI(new StreamCharacterIterator(new StringBufferInputStream(toMatch))))
                    return;

                log.append("   Match using ReaderCharacterIterator\n");
                if (!tryMatchUsingCI(new ReaderCharacterIterator(new StringReader(toMatch))))
                    return;
View Full Code Here

      // Update the configuration XML file using the generated XSLT.  For now,
      // place the generated file into the undeploy directory:
      File configFile = new File(path);
      File outputFile = new File(this.undeployDir, configFile.getName());
      InputStream configStream = new FileInputStream(configFile);
      InputStream xsltStream = new StringBufferInputStream(buf.toString());
      OutputStream outputStream = new FileOutputStream(outputFile);
      XslTransformer.applyTransformation(configStream, outputStream, xsltStream, null);
      configStream.close();
      xsltStream.close();
      outputStream.close();

      // Now that we have the generated file, move it to its proper location
      if (!configFile.delete())
         throw new Exception("Update failed for '" + name + "', unable to delete old configuration file: " + path);
View Full Code Here

                log.append("   Match using CharacterArrayCharacterIterator\n");
                if (!tryMatchUsingCI(new CharacterArrayCharacterIterator(toMatch.toCharArray(), 0, toMatch.length())))
                    return;

                log.append("   Match using StreamCharacterIterator\n");
                if (!tryMatchUsingCI(new StreamCharacterIterator(new StringBufferInputStream(toMatch))))
                    return;

                log.append("   Match using ReaderCharacterIterator\n");
                if (!tryMatchUsingCI(new ReaderCharacterIterator(new StringReader(toMatch))))
                    return;
View Full Code Here

    }

    public void testSimpleNonTextMessage() throws MessagingException, TransformerException
    {
        MimeMessage message = new MimeMessage(Session.getDefaultInstance(new Properties()));
        message.setContent(new StringBufferInputStream(TEXT), "application/octet-stream");
        message.setRecipient(Message.RecipientType.TO, new InternetAddress(TO));
        assertEquals("", transformer.transform(message));
    }
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.