public abstract class StreamUtility extends Object
| Constructor and Description |
|---|
StreamUtility() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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)
Copyright © 2013 DuraSpace. All Rights Reserved.