Examples of StringBuilderWriter


Examples of org.apache.commons.io.output.StringBuilderWriter

            String pref = e.getKey();
            nss.declarePrefix(pref == null ? "" : pref, e.getValue());
        }
    }
    String getInsertUpdateRawMessage(Feature feature) {
        final StringBuilderWriter sw = new StringBuilderWriter();
        long start = System.nanoTime();
        boolean success = true;
        try {
            long modCount = catalogModCount.get();
            if(modCount != catalogModCountLocal.get().longValue()) {
                catalogModCountLocal.set(modCount);
                encoder.remove();
            }
           
            final Encoder encoder = this.encoder.get();

            TransformerHandler handler = STF.newTransformerHandler();
            handler.setResult(new StreamResult(sw));

            encoder.setInline(true);
            loadNamespaceBindings(encoder.getNamespaces(), feature, xmlConfig.getXSD().getSchema());
           
            encoder.encode(feature, GML._Feature, handler);

            return sw.toString();
        } catch(Exception e) {
            success = false;
            throw new WFSException(e);
        } finally {
            if(success) {
                double millis = ((double) System.nanoTime() - start) / 1000000;
                Name name = WFSNotify.getTypeName(feature);
                serializationMillis.add(millis);
                serializationChars.add(sw.getBuilder().length());
                Statistics statsByType = serializationMillisByType.get(name);
                if(statsByType == null) {
                    Statistics newStats = new Statistics();
                    statsByType = serializationMillisByType.put(name, newStats);
                    if(statsByType == null) {
View Full Code Here

Examples of org.more.util.io.output.StringBuilderWriter

     * @throws NullPointerException if the input is null
     * @throws IOException if an I/O error occurs
     * @since 2.3
     */
    public static String toString(final InputStream input, final Charset encoding) throws IOException {
        StringBuilderWriter sw = new StringBuilderWriter();
        IOUtils.copy(input, sw, encoding);
        return sw.toString();
    }
View Full Code Here

Examples of org.more.util.io.output.StringBuilderWriter

     * @return the requested String
     * @throws NullPointerException if the input is null
     * @throws IOException if an I/O error occurs
     */
    public static String toString(final Reader input) throws IOException {
        StringBuilderWriter sw = new StringBuilderWriter();
        IOUtils.copy(input, sw);
        return sw.toString();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.