liquibase.util
public class StreamUtil extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
lineSeparator |
Constructor and Description |
---|
StreamUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
closeQuietly(java.io.Closeable input) |
static void |
closeQuietly(java.io.InputStream input) |
static void |
closeQuietly(java.io.Reader input) |
static void |
copy(java.io.InputStream inputStream,
java.io.OutputStream outputStream) |
static long |
getContentLength(java.io.InputStream in) |
static long |
getContentLength(java.io.Reader reader) |
static java.lang.String |
getLineSeparator() |
static java.lang.String |
getReaderContents(java.io.Reader reader)
Reads all the characters into a String.
|
static java.lang.String |
getStreamContents(java.io.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 java.lang.String |
getStreamContents(java.io.InputStream ins,
java.lang.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 java.io.InputStream |
openStream(java.lang.String path,
java.lang.Boolean relativeToChangelogFile,
ChangeSet changeSet,
ResourceAccessor resourceAccessor) |
public static java.lang.String getLineSeparator()
public static java.lang.String getStreamContents(java.io.InputStream ins) throws java.io.IOException
ins
- The InputStream to read.java.io.IOException
- If there is an error reading the stream.public static java.lang.String getStreamContents(java.io.InputStream ins, java.lang.String charsetName) throws java.io.IOException
ins
- The InputStream to read.charsetName
- The name of a supported
charset
java.io.IOException
- If there is an error reading the stream.public static java.lang.String getReaderContents(java.io.Reader reader) throws java.io.IOException
reader
- The Reader to read.java.io.IOException
- If there is an error reading the stream.public static void copy(java.io.InputStream inputStream, java.io.OutputStream outputStream) throws java.io.IOException
java.io.IOException
public static long getContentLength(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static long getContentLength(java.io.Reader reader) throws java.io.IOException
java.io.IOException
public static void closeQuietly(java.io.Reader input)
public static void closeQuietly(java.io.InputStream input)
public static void closeQuietly(java.io.Closeable input)
public static java.io.InputStream openStream(java.lang.String path, java.lang.Boolean relativeToChangelogFile, ChangeSet changeSet, ResourceAccessor resourceAccessor) throws java.io.IOException
java.io.IOException