Package org.dishevelled.compress
Class Writers
- java.lang.Object
-
- org.dishevelled.compress.Writers
-
public final class Writers extends Object
File and output stream writers with support for bgzf, gzip, and bzip2 compression.- Author:
- Michael Heuer
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PrintWriter
bgzfOutputStreamWriter(OutputStream outputStream)
Create and return a new buffered print writer with bgzf compression for the specified output stream.static PrintWriter
bzip2OutputStreamWriter(OutputStream outputStream)
Create and return a new buffered print writer with bzip2 compression for the specified output stream.static PrintWriter
gzipOutputStreamWriter(OutputStream outputStream)
Create and return a new buffered print writer with gzip compression for the specified output stream.static PrintWriter
writer(File file)
Create and return a new buffered print writer with support for bgzf, gzip, bzip2, or zstd compression for the specified file orstdout
if the file is null.static PrintWriter
writer(File file, boolean append)
Create and return a new buffered print writer with support for bgzf, gzip, bzip2, or zstd compression for the specified file orstdout
if the file is null.static PrintWriter
zstdOutputStreamWriter(OutputStream outputStream)
Create and return a new buffered print writer with Zstandard (zstd) compression for the specified output stream.
-
-
-
Method Detail
-
bgzfOutputStreamWriter
public static PrintWriter bgzfOutputStreamWriter(OutputStream outputStream) throws IOException
Create and return a new buffered print writer with bgzf compression for the specified output stream.- Parameters:
outputStream
- output stream, must not be null- Returns:
- a new buffered print writer with bgzf compression for the specified output stream
- Throws:
IOException
- if an I/O error occurs- Since:
- 1.3
-
gzipOutputStreamWriter
public static PrintWriter gzipOutputStreamWriter(OutputStream outputStream) throws IOException
Create and return a new buffered print writer with gzip compression for the specified output stream.- Parameters:
outputStream
- output stream, must not be null- Returns:
- a new buffered print writer with gzip compression for the specified output stream
- Throws:
IOException
- if an I/O error occurs
-
bzip2OutputStreamWriter
public static PrintWriter bzip2OutputStreamWriter(OutputStream outputStream) throws IOException
Create and return a new buffered print writer with bzip2 compression for the specified output stream.- Parameters:
outputStream
- output stream, must not be null- Returns:
- a new buffered print writer with bzip2 compression for the specified output stream
- Throws:
IOException
- if an I/O error occurs
-
zstdOutputStreamWriter
public static PrintWriter zstdOutputStreamWriter(OutputStream outputStream) throws IOException
Create and return a new buffered print writer with Zstandard (zstd) compression for the specified output stream.- Parameters:
outputStream
- output stream, must not be null- Returns:
- a new buffered print writer with Zstandard (zstd) compression for the specified output stream
- Throws:
IOException
- if an I/O error occurs- Since:
- 1.4
-
writer
public static PrintWriter writer(@Nullable File file) throws IOException
Create and return a new buffered print writer with support for bgzf, gzip, bzip2, or zstd compression for the specified file orstdout
if the file is null.- Parameters:
file
- file, if any- Returns:
- a new buffered print writer with support for bgzf, gzip, bzip2, or zstd compression for
the specified file or
stdout
if the file is null - Throws:
IOException
- if an I/O error occurs
-
writer
public static PrintWriter writer(@Nullable File file, boolean append) throws IOException
Create and return a new buffered print writer with support for bgzf, gzip, bzip2, or zstd compression for the specified file orstdout
if the file is null.- Parameters:
file
- file, if anyappend
- true to append to the specified file- Returns:
- a new buffered print writer with support for bgzf, gzip, bzip2, or zstd compression for
the specified file or
stdout
if the file is null - Throws:
IOException
- if an I/O error occurs
-
-