Example usage for com.google.common.io CharSource CharSource

List of usage examples for com.google.common.io CharSource CharSource

Introduction

In this page you can find the example usage for com.google.common.io CharSource CharSource.

Prototype

protected CharSource() 

Source Link

Document

Constructor for use by subclasses.

Usage

From source file:org.dishevelled.compress.Sources.java

/**
 * Create and return a new gzip compressed char source for the specified input stream.
 *
 * @since 1.3/*from www.  j  a va  2  s. co m*/
 * @param inputStream input stream, must not be null
 * @return a new gzip compressed char source for the specified input stream
 */
public static CharSource gzipInputStreamCharSource(final InputStream inputStream) {
    checkNotNull(inputStream);
    return new CharSource() {
        @Override
        public Reader openStream() throws IOException {
            return Readers.gzipInputStreamReader(inputStream);
        }
    };
}

From source file:org.dishevelled.compress.Sources.java

/**
 * Create and return a new bzip2 compressed char source for the specified input stream.
 *
 * @since 1.3/* www  .j  a v  a2s  . co m*/
 * @param inputStream input stream, must not be null
 * @return a new bzip2 compressed char source for the specified input stream
 */
public static CharSource bzip2InputStreamCharSource(final InputStream inputStream) {
    checkNotNull(inputStream);
    return new CharSource() {
        @Override
        public Reader openStream() throws IOException {
            return Readers.bzip2InputStreamReader(inputStream);
        }
    };
}

From source file:org.dishevelled.compress.Sources.java

/**
 * Create and return a new block compressed gzip (BGZF) char source for the specified file.
 *
 * @since 1.3// w  w  w  .  ja  v a  2 s .  co m
 * @param file file, must not be null
 * @return a new block compressed gzip (BGZF) char source for the specified file
 */
public static CharSource bgzfFileCharSource(final File file) {
    checkNotNull(file);
    return new CharSource() {
        @Override
        public Reader openStream() throws IOException {
            return Readers.bgzfFileReader(file);
        }
    };
}

From source file:org.dishevelled.compress.Sources.java

/**
 * Create and return a new gzip compressed char source for the specified file.
 *
 * @since 1.3//from ww  w  .  j  a  v a 2 s  .  c o m
 * @param file file, must not be null
 * @return a new gzip compressed char source for the specified file
 */
public static CharSource gzipFileCharSource(final File file) {
    checkNotNull(file);
    return new CharSource() {
        @Override
        public Reader openStream() throws IOException {
            return Readers.gzipFileReader(file);
        }
    };
}

From source file:org.dishevelled.compress.Sources.java

/**
 * Create and return a new bzip2 compressed char source for the specified file.
 *
 * @since 1.3/*from   ww  w . ja va 2s . c o  m*/
 * @param file file, must not be null
 * @return a new bzip2 compressed char source for the specified file
 */
public static CharSource bzip2FileCharSource(final File file) {
    checkNotNull(file);
    return new CharSource() {
        @Override
        public Reader openStream() throws IOException {
            return Readers.bzip2FileReader(file);
        }
    };
}