Package liquibase.util
Class StreamUtil
- java.lang.Object
-
- liquibase.util.StreamUtil
-
public abstract class StreamUtil extends Object
Utilities for working with streams.
-
-
Constructor Summary
Constructors Constructor Description StreamUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidcopy(InputStream inputStream, OutputStream outputStream)static StringgetLineSeparator()static InputStreamopenStream(String path, Boolean relativeToChangelogFile, ChangeSet changeSet, ResourceAccessor resourceAccessor)Deprecated.static byte[]readStream(InputStream stream)static StringreadStreamAsString(InputStream stream)CallsreadStreamAsString(InputStream, String)withGlobalConfiguration.FILE_ENCODINGas the encodingstatic StringreadStreamAsString(InputStream stream, String encoding)Returns the given stream as a string using the given encoding.static ReaderreadStreamWithReader(InputStream stream, String encoding)
-
-
-
Method Detail
-
getLineSeparator
public static String getLineSeparator()
-
copy
public static void copy(InputStream inputStream, OutputStream outputStream) throws IOException
- Throws:
IOException
-
readStream
public static byte[] readStream(InputStream stream) throws IOException
- Throws:
IOException
-
readStreamAsString
public static String readStreamAsString(InputStream stream) throws IOException
CallsreadStreamAsString(InputStream, String)withGlobalConfiguration.FILE_ENCODINGas the encoding- Throws:
IOException
-
readStreamAsString
public static String readStreamAsString(InputStream stream, String encoding) throws IOException
Returns the given stream as a string using the given encoding. If encoding is null, useGlobalConfiguration.FILE_ENCODING- Throws:
IOException
-
readStreamWithReader
public static Reader readStreamWithReader(InputStream stream, String encoding) throws IOException
- Throws:
IOException
-
openStream
public static InputStream openStream(String path, Boolean relativeToChangelogFile, ChangeSet changeSet, ResourceAccessor resourceAccessor) throws IOException
Deprecated.- Throws:
IOException
-
-