|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.ontopia.utils.StreamUtils
public class StreamUtils
INTERNAL: Utilities for working with streams and readers.
Constructor Summary | |
---|---|
StreamUtils()
|
Method Summary | |
---|---|
static boolean |
compare(InputStream r1,
InputStream r2)
INTERNAL: Compares the contents of the two InputStreams for equality. |
static boolean |
compare(Reader r1,
Reader r2)
INTERNAL: Compares the contents of the two Readers for equality. |
static boolean |
compareAndClose(InputStream r1,
InputStream r2)
INTERNAL: Compares the contents of the two InputStream for equality and closes them afterwards. |
static InputStream |
getInputStream(File basedir,
String name)
INTERNAL: Returns an input stream for the given url. |
static InputStream |
getInputStream(String name)
INTERNAL: Same as getInputStream(null, name); |
static URL |
getResource(String name)
INTERNAL: Returns an input stream for the given url. |
static byte[] |
read(InputStream in)
INTERNAL: Returns the entire contents of a stream as a byte array. |
static byte[] |
read(InputStream in,
int length)
INTERNAL: Returns the first given number of bytes of a stream into a byte array. |
static String |
read(Reader in)
INTERNAL: Returns the entire contents of a stream (well, Reader) as a string. |
static String |
readString(Reader r,
long length)
|
static void |
transfer(InputStream in,
OutputStream out)
INTERNAL: Transfers the entire contents of the InputStream to the OutputStream without modifying them in any way. |
static void |
transfer(Reader in,
Writer out)
INTERNAL: Transfers the entire contents of the Reader to the Writer without modifying them in any way. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StreamUtils()
Method Detail |
---|
public static void transfer(InputStream in, OutputStream out) throws IOException
IOException
public static void transfer(Reader in, Writer out) throws IOException
IOException
public static String read(Reader in) throws IOException
IOException
public static byte[] read(InputStream in, int length) throws IOException
IOException
public static byte[] read(InputStream in) throws IOException
IOException
public static boolean compare(InputStream r1, InputStream r2) throws IOException
IOException
public static boolean compareAndClose(InputStream r1, InputStream r2) throws IOException
IOException
public static boolean compare(Reader r1, Reader r2) throws IOException
IOException
public static InputStream getInputStream(String name) throws IOException
IOException
public static InputStream getInputStream(File basedir, String name) throws IOException
IOException
public static URL getResource(String name) throws IOException
IOException
public static String readString(Reader r, long length) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |