|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.cloudera.lib.io.IOUtils
public abstract class IOUtils
Constructor Summary | |
---|---|
IOUtils()
|
Method Summary | |
---|---|
static void |
copy(InputStream is,
OutputStream os)
Copies an inputstream to an outputstream. |
static void |
copy(InputStream is,
OutputStream os,
long offset,
long len)
Copies a range of bytes from an inputstream to an outputstream. |
static void |
copy(Reader reader,
Writer writer)
Copies a reader to a writer. |
static void |
copy(Reader reader,
Writer writer,
long offset,
long len)
Copies a range of chars from a reader to a writer. |
static void |
delete(File file)
Deletes the specified path recursively. |
static String |
toString(Reader reader)
Reads a reader into a string. |
static void |
zipDir(File dir,
String relativePath,
ZipOutputStream zos)
Zips the contents of a directory into a zip outputstream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IOUtils()
Method Detail |
---|
public static void delete(File file) throws IOException
file
- path to delete.
IOException
- thrown if an IO error occurred.public static void copy(InputStream is, OutputStream os) throws IOException
is
- inputstream to copy.os
- target outputstream.
IOException
- thrown if an IO error occurred.public static void copy(InputStream is, OutputStream os, long offset, long len) throws IOException
is
- inputstream to copy.os
- target outputstream.offset
- of the inputstream to start the copy from, the offset
is relative to the current position.len
- length of the inputstream to copy, -1
means
until the end of the inputstream.
IOException
- thrown if an IO error occurred.public static void copy(Reader reader, Writer writer) throws IOException
reader
- reader to copy.writer
- target writer.
IOException
- thrown if an IO error occurred.public static void copy(Reader reader, Writer writer, long offset, long len) throws IOException
reader
- reader to copy.writer
- target writer.offset
- of the reader to start the copy from, the offset
is relative to the current position.len
- length of the reader to copy, -1
means
until the end of the reader.
IOException
- thrown if an IO error occurred.public static String toString(Reader reader) throws IOException
reader
- reader to read.
IOException
- thrown if an IO error occurred.public static void zipDir(File dir, String relativePath, ZipOutputStream zos) throws IOException
dir
- directory contents to zip.relativePath
- relative path top prepend to all files in the zip.zos
- zip output stream
IOException
- thrown if an IO error occurred.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |