public class StreamUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
lineSeparator |
Constructor and Description |
---|
StreamUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
closeQuietly(Closeable input) |
static void |
closeQuietly(InputStream input) |
static void |
closeQuietly(Reader input) |
static void |
copy(InputStream inputStream,
OutputStream outputStream) |
static long |
getContentLength(InputStream in) |
static long |
getContentLength(Reader reader) |
static String |
getLineSeparator() |
static String |
getReaderContents(Reader reader)
Reads all the characters into a String.
|
static String |
getStreamContents(InputStream ins)
Reads a stream until the end of file into a String and uses the machines
default encoding to convert to characters the bytes from the Stream.
|
static String |
getStreamContents(InputStream ins,
String charsetName)
Reads a stream until the end of file into a String and uses the machines
default encoding to convert to characters the bytes from the Stream.
|
static InputStream |
openStream(String path,
Boolean relativeToChangelogFile,
ChangeSet changeSet,
ResourceAccessor resourceAccessor) |
public static final String lineSeparator
public static String getLineSeparator()
public static String getStreamContents(InputStream ins) throws IOException
ins
- The InputStream to read.IOException
- If there is an error reading the stream.public static String getStreamContents(InputStream ins, String charsetName) throws IOException
ins
- The InputStream to read.charsetName
- The name of a supported
charset
IOException
- If there is an error reading the stream.public static String getReaderContents(Reader reader) throws IOException
reader
- The Reader to read.IOException
- If there is an error reading the stream.public static void copy(InputStream inputStream, OutputStream outputStream) throws IOException
IOException
public static long getContentLength(InputStream in) throws IOException
IOException
public static long getContentLength(Reader reader) throws IOException
IOException
public static void closeQuietly(Reader input)
public static void closeQuietly(InputStream input)
public static void closeQuietly(Closeable input)
public static InputStream openStream(String path, Boolean relativeToChangelogFile, ChangeSet changeSet, ResourceAccessor resourceAccessor) throws IOException
IOException
Copyright © 2014 Liquibase.org. All rights reserved.