|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.zig_project.gpl.common.io.Transfer
The Transfer class provides a library of functions that may be called to simplify routine IO operations.
Field Summary | |
static int |
SUGGESTED_CHUNK_SIZE
Suggested size for a buffer in order to perform bulk operations |
Constructor Summary | |
Transfer()
|
Method Summary | |
static void |
byteTransfer(InputStream is,
OutputStream os)
Transfers data from the InputStream to the OutputStream, one byte at a time. |
static byte[] |
loadFileBytes(File src)
Convenience method to load an entire file into a single byte[] buffer. |
static String |
loadTextFile(File src)
Convenience method to load an entire text file into memory, and return the complete contents as a single String (using the platforms default encoding). |
static void |
shutDown(InputStream is,
IOExceptionHandler handler)
Convenience method to attempt to close an InputStream. |
static void |
shutDown(OutputStream os,
IOExceptionHandler handler)
Convenience method to attempt to close an OutputStream. |
static void |
skip(InputStream is,
long n)
This version of skip always skips n bytes, or throws an IOException if the skip can not be fully completed. |
static void |
skip(Reader r,
long n)
This version of skip always skips n bytes, or throws an IOException if the skip can not be fully completed. |
static void |
transfer(InputStream is,
OutputStream os)
Convenience method for a bulk transfer operation. |
static void |
transfer(InputStream is,
OutputStream os,
byte[] slurp)
Uses the buffer slurp to perform a bulk transfer operation from the InputStream, until it is exhausted. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SUGGESTED_CHUNK_SIZE
Constructor Detail |
public Transfer()
Method Detail |
public static void byteTransfer(InputStream is, OutputStream os) throws IOException
IOException
public static void transfer(InputStream is, OutputStream os) throws IOException
IOException
transfer(InputStream, OutputStream, byte[])
public static void transfer(InputStream is, OutputStream os, byte[] slurp) throws IOException
IOException
public static byte[] loadFileBytes(File src) throws IOException
IOException
public static String loadTextFile(File src) throws IOException
IOException
loadFileBytes(File)
public static void shutDown(InputStream is, IOExceptionHandler handler)
public static void shutDown(OutputStream os, IOExceptionHandler handler)
public static void skip(InputStream is, long n) throws IOException
IOException
public static void skip(Reader r, long n) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |