Examples of openBufferedStream()


Examples of com.google.common.io.ByteSink.openBufferedStream()

            }
        }

        Closer closer = Closer.create();
        try {
            OutputStream os = closer.register(sink.openBufferedStream());
            mapper.writeValue(os, object);
        } finally {
            closer.close();
        }
    }
View Full Code Here

Examples of com.google.common.io.CharSink.openBufferedStream()

        if (append) {
          charSink = Files.asCharSink(outputFile, Charsets.UTF_8, FileWriteMode.APPEND);
        } else {
          charSink = Files.asCharSink(outputFile, Charsets.UTF_8);
        }
        this.output = charSink.openBufferedStream();
      } catch (IOException e) {
        throw new BuildException(e);
      }
    } else {
      if (!UNICODE_ENCODINGS.contains(Charset.defaultCharset().name())) {
View Full Code Here

Examples of com.google.common.io.CharSource.openBufferedStream()

        final CharSource charSource = byteSource.asCharSource(Constants.DEFAULT_CHARSET);
        BufferedReader reader = null;
        final Style[] styles;
        try {
            reader = charSource.openBufferedStream();

            final SLDParser sldParser = new SLDParser(CommonFactoryFinder.getStyleFactory());
            sldParser.setInput(reader);
            styles = sldParser.readXML();
View Full Code Here

Examples of com.google.common.io.CharSource.openBufferedStream()

        Closer closer = Closer.create();
        try {
            Reader input;
            if (url.getProtocol().equalsIgnoreCase("file")) {
                final CharSource charSource = Files.asCharSource(new File(url.getFile()), Constants.DEFAULT_CHARSET);
                input = closer.register(charSource.openBufferedStream());
            } else {
                final ClientHttpResponse response = closer.register(this.httpRequestFactory.createRequest(url.toURI(),
                        HttpMethod.GET).execute());

                input = closer.register(new BufferedReader(new InputStreamReader(response.getBody(), Constants.DEFAULT_CHARSET)));
View Full Code Here

Examples of com.google.common.io.CharSource.openBufferedStream()

    private StringBuilder getLimitedOutput(FileBackedOutputStream out, final int limit)
            throws IOException {

        CharSource charSource = out.asByteSource().asCharSource(Charsets.UTF_8);
        BufferedReader reader = charSource.openBufferedStream();
        final StringBuilder output = new StringBuilder();
        int count = 0;
        String line;
        while ((line = reader.readLine()) != null) {
            output.append(line).append('\n');
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.