Package xbird.util.io

Examples of xbird.util.io.FastBufferedWriter


            throw new IllegalArgumentException();
        }
        try {
            FileOutputStream out = new FileOutputStream(file, append);
            OutputStreamWriter osw = new OutputStreamWriter(out, encoding);
            this._writer = new FastBufferedWriter(osw, 16384);
        } catch (IOException e) {
            throw new IllegalStateException("failed to writer to file: " + file.getAbsolutePath(), e);
        }
    }
View Full Code Here


    private void execute(Reader reader) throws XQueryException {
        final Writer writer;
        if(_out != null) {
            try {
                writer = new FastBufferedWriter(new OutputStreamWriter(new FileOutputStream(_out), _encoding), 8192);
            } catch (IOException e) {
                throw new DynamicError("Illegal Output file: " + e.getMessage());
            }
        } else {
            writer = new FastBufferedWriter(new OutputStreamWriter(System.out, Charset.forName(_encoding)), 4096);
        }

        if(_remoteEndpoint != null) {
            try {
                executeAt(reader, writer, _remoteEndpoint);
View Full Code Here

            IOException, XQueryException {
        XQEngine engine = new XQEngineClient(remoteEndpoint);
        String query = IOUtils.toString(new FileInputStream(fileName));
        QueryRequest request = new QueryRequest(query, ReturnType.ASYNC_REMOTE_SEQUENCE);
        Sequence<Item> resultSeq = (Sequence<Item>) engine.execute(request);
        Writer writer = new FastBufferedWriter(new OutputStreamWriter(System.out), 4096);
        SAXWriter saxwr = new SAXWriter(writer, "UTF-8");
        Serializer ser = new SAXSerializer(saxwr, writer);
        ser.emit(resultSeq);
        writer.flush();
    }
View Full Code Here

    public SAXWriter(OutputStream os) {
        this(os, DEFAULT_ENCODING);
    }

    public SAXWriter(OutputStream os, String encoding) {
        this(new FastBufferedWriter(new OutputStreamWriter(os, Charset.forName(encoding)), 4096), encoding);
    }
View Full Code Here

        // print result
        final Writer writer;
        if(_out != null) {
            try {
                writer = new FastBufferedWriter(new OutputStreamWriter(new FileOutputStream(_out), _encoding), 8192);
            } catch (IOException e) {
                throw new DynamicError("Illegal Output file: " + e.getMessage());
            }
        } else {
            writer = new FastBufferedWriter(new OutputStreamWriter(System.out, Charset.forName(_encoding)), 4096);
        }
        if(_pull) {
            executeWithPullMode(proc, module, writer);
        } else {
            executeWithPushMode(proc, module, writer);
View Full Code Here

TOP

Related Classes of xbird.util.io.FastBufferedWriter

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.