public class IOLib
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BUFFER_SIZE |
| Constructor and Description |
|---|
IOLib() |
| Modifier and Type | Method and Description |
|---|---|
static long |
checksum(byte[] victim)
Generates a checksum for the given byte array.
|
static long |
dataCopy(java.io.DataInput source,
java.io.DataOutput sink,
int howMany)
Binary copies up to the given number of bytes from a DataInput object to
an DataOutput object.
|
static long |
dataToStream(java.io.DataInput source,
java.io.OutputStream sink,
int howMany) |
static long |
dataToStream(java.io.DataInput source,
java.io.OutputStream sink,
int howMany,
java.security.MessageDigest digest)
Binary copies up to the given number of bytes from a DataInput object to
an output stream.
|
static byte[] |
readBytesFromStream(java.io.InputStream innie)
Reads the entirety of the given input stream in as a byte array and returns the result.
|
static java.lang.String |
readTextFromReader(java.io.Reader reader)
Reads the entirety of the given reader in as a String and returns the result.
|
static java.lang.String |
readTextFromResource(java.lang.Class baseClass,
java.lang.String resourcePath)
Reads text from a file resource in the classpath.
|
static java.lang.String |
readTextFromStream(java.io.InputStream innie)
Reads the entirety of the given input stream in as a String and returns the result.
|
static long |
streamCopy(java.io.InputStream source,
java.io.OutputStream sink)
Binary copies bytes from an input stream to an output stream.
|
static long |
streamCopy(java.io.InputStream source,
java.io.OutputStream sink,
ActivityProgress progress,
int progressLevel) |
static long |
streamCopy(java.io.InputStream source,
java.io.OutputStream sink,
int howMany)
Binary copies up to the given number of bytes from an input stream to an
output stream.
|
static long |
streamCopy(java.io.InputStream source,
java.io.OutputStream sink,
int howMany,
java.security.MessageDigest digest)
Binary copies up to the given number of bytes from an input stream to an
output stream.
|
static long |
streamCopyWithChecksum(java.io.InputStream source,
java.io.OutputStream sink,
int howMany)
Binary copies up to the given number of bytes from an input stream to an
output stream.
|
static long |
textCopy(java.io.Reader source,
java.io.Writer sink)
Copies text from a read to a writer.
|
static long |
textCopy(java.io.Reader source,
java.io.Writer sink,
ActivityProgress progress,
int progressLevel) |
static long |
textCopy(java.io.Reader source,
java.io.Writer sink,
int howMany)
Binary copies up to the given number of bytes from an input stream to an
output stream.
|
static void |
writeBytesToStream(byte[] bytes,
java.io.OutputStream outie)
Writes the given bytes to the given OutputStream.
|
static void |
writeTextToStream(java.lang.String text,
java.io.OutputStream outie)
Writes the given String to the given OutputStream.
|
static void |
writeTextToWriter(java.lang.String text,
java.io.Writer writer)
Writes the given String to the given Writer.
|
public static final int BUFFER_SIZE
public static java.lang.String readTextFromResource(java.lang.Class baseClass,
java.lang.String resourcePath)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String readTextFromStream(java.io.InputStream innie)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String readTextFromReader(java.io.Reader reader)
throws java.io.IOException
java.io.IOExceptionpublic static void writeTextToStream(java.lang.String text,
java.io.OutputStream outie)
throws java.io.IOException
java.io.IOExceptionpublic static void writeTextToWriter(java.lang.String text,
java.io.Writer writer)
throws java.io.IOException
java.io.IOExceptionpublic static byte[] readBytesFromStream(java.io.InputStream innie)
throws java.io.IOException
java.io.IOExceptionpublic static void writeBytesToStream(byte[] bytes,
java.io.OutputStream outie)
throws java.io.IOException
java.io.IOExceptionpublic static long streamCopy(java.io.InputStream source,
java.io.OutputStream sink)
throws java.io.IOException
java.io.IOExceptionpublic static long streamCopy(java.io.InputStream source,
java.io.OutputStream sink,
ActivityProgress progress,
int progressLevel)
throws java.io.IOException
java.io.IOExceptionpublic static long streamCopy(java.io.InputStream source,
java.io.OutputStream sink,
int howMany)
throws java.io.IOException
java.io.IOExceptionpublic static long streamCopy(java.io.InputStream source,
java.io.OutputStream sink,
int howMany,
java.security.MessageDigest digest)
throws java.io.IOException
java.io.IOExceptionpublic static long textCopy(java.io.Reader source,
java.io.Writer sink)
throws java.io.IOException
java.io.IOExceptionpublic static long textCopy(java.io.Reader source,
java.io.Writer sink,
ActivityProgress progress,
int progressLevel)
throws java.io.IOException
java.io.IOExceptionpublic static long textCopy(java.io.Reader source,
java.io.Writer sink,
int howMany)
throws java.io.IOException
java.io.IOExceptionpublic static long dataToStream(java.io.DataInput source,
java.io.OutputStream sink,
int howMany)
throws java.io.IOException
java.io.IOExceptionpublic static long dataToStream(java.io.DataInput source,
java.io.OutputStream sink,
int howMany,
java.security.MessageDigest digest)
throws java.io.IOException
java.io.IOExceptionpublic static long streamCopyWithChecksum(java.io.InputStream source,
java.io.OutputStream sink,
int howMany)
throws java.io.IOException
java.io.IOExceptionpublic static long dataCopy(java.io.DataInput source,
java.io.DataOutput sink,
int howMany)
throws java.io.IOException
java.io.IOExceptionpublic static long checksum(byte[] victim)
throws java.io.IOException
java.io.IOException