|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fcrepo.server.utilities.StreamUtility
public abstract class StreamUtility
Utility methods for working with character-based or raw sequences of data.
| Constructor Summary | |
|---|---|
StreamUtility()
|
|
| Method Summary | |
|---|---|
static void |
enc(char[] in,
int start,
int length,
StringBuffer out)
Appends an XML-appropriate encoding of the given range of characters to the given StringBuffer. |
static void |
enc(char in,
StringBuffer out)
Appends an XML-appropriate encoding of the given character to the given StringBuffer. |
static String |
enc(String in)
Returns an XML-appropriate encoding of the given String. |
static void |
enc(String in,
StringBuffer out)
Appends an XML-appropriate encoding of the given String to the given StringBuffer. |
static byte[] |
getBytes(InputStream in)
Gets a byte array for the given input stream. |
static InputStream |
getStream(String string)
Gets a stream for the given string. |
static void |
pipeStream(InputStream in,
OutputStream out,
int bufSize)
Copies the contents of an InputStream to an OutputStream, then closes both. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StreamUtility()
| Method Detail |
|---|
public static String enc(String in)
in - The String to encode.
public static void enc(String in,
StringBuffer out)
in - The String to encode.out - The StringBuffer to write to.
public static void enc(char[] in,
int start,
int length,
StringBuffer out)
in - The char buffer to read from.start - The starting index.length - The number of characters in the range.out - The StringBuffer to write to.
public static void enc(char in,
StringBuffer out)
in - The character.out - The StringBuffer to write to.
public static void pipeStream(InputStream in,
OutputStream out,
int bufSize)
throws IOException
in - The source stream.out - The target stram.bufSize - Number of bytes to attempt to copy at a time.
IOException - If any sort of read/write error occurs on either stream.
public static byte[] getBytes(InputStream in)
throws IOException
IOExceptionpublic static InputStream getStream(String string)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||