|
Oracle® WebCenter Content Site Studio for External Applications Java API Reference 11g Release 1 (11.1.1) E17273-03 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
oracle.stellent.wcm.common.io.StreamUtil
public abstract class StreamUtil
Utility methods for stream processing
| Field Summary | |
|---|---|
protected static ILog |
s_log |
| Constructor Summary | |
|---|---|
StreamUtil() |
|
| Method Summary | |
|---|---|
static void |
closeReader(java.io.Reader reader)Close a reader, ignoring any exceptions that occur during the close |
static void |
closeStream(java.io.InputStream stream)Close a stream, ignoring any exceptions that occur during the close |
static void |
closeStream(java.io.OutputStream stream)Close a stream, ignoring any exceptions that occur during the close |
static void |
closeWriter(java.io.Writer writer)Close a writer, ignoring any exceptions that occur during the close |
static int |
copyReader(java.io.Reader reader, java.io.Writer writer, boolean closeInput, boolean closeOutput)Copy the contents of the Reader to the Writer |
static int |
copyStream(java.io.InputStream inputStream, java.io.OutputStream outputStream, boolean closeInput, boolean closeOutput)Copy the contents of the inputstream to the outputstream |
static int |
copyStream(java.io.InputStream inputStream, java.io.OutputStream outputStream, boolean closeInput, boolean closeOutput, int count)Copy the contents of the inputstream to the outputstream |
static java.lang.String |
getStringFromFile(java.io.File file)Convert the contents of the file into a string |
static java.lang.String |
getStringFromFile(java.io.File file, java.lang.String encoding)Convert the contents of the file into a string |
static java.lang.String |
getStringFromStream(java.io.InputStream stream)Read the stream and create a string using the default system encoding |
static java.lang.String |
getStringFromStream(java.io.InputStream stream, java.lang.String encoding)Read the stream and create a string from the contents, using the given encoding |
static java.lang.String |
getStringFromStream(java.io.InputStream stream, java.lang.String encoding, boolean closeStream)Read the stream and create a string from the contents, using the given encoding |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static ILog s_log
| Constructor Detail |
|---|
public StreamUtil()
| Method Detail |
|---|
public static int copyStream(java.io.InputStream inputStream,
java.io.OutputStream outputStream,
boolean closeInput,
boolean closeOutput)
throws java.io.IOException
inputStream - the inputstream to readoutputStream - the outputstream to write tocloseInput - true to close the inputstream on completioncloseOutput - true to close the outputstream on completionjava.io.IOException - if an IO error occurs
public static int copyStream(java.io.InputStream inputStream,
java.io.OutputStream outputStream,
boolean closeInput,
boolean closeOutput,
int count)
throws java.io.IOException
inputStream - the inputstream to readoutputStream - the outputstream to write tocloseInput - true to close the inputstream on completioncloseOutput - true to close the outputstream on completioncount - the number of bytes to copyjava.io.IOException - if an IO error occurs
public static int copyReader(java.io.Reader reader,
java.io.Writer writer,
boolean closeInput,
boolean closeOutput)
throws java.io.IOException
reader - the Reader to readwriter - the Writer to write tocloseInput - true to close the inputstream on completioncloseOutput - true to close the outputstream on completionjava.io.IOException - if an IO error occurspublic static void closeStream(java.io.InputStream stream)
stream - the stream to closepublic static void closeStream(java.io.OutputStream stream)
stream - the stream to closepublic static void closeReader(java.io.Reader reader)
reader - the reader to closepublic static void closeWriter(java.io.Writer writer)
writer - the writer to close
public static java.lang.String getStringFromFile(java.io.File file)
throws java.io.IOException
file - the file to readjava.io.IOException
public static java.lang.String getStringFromFile(java.io.File file,
java.lang.String encoding)
throws java.io.IOException
file - the file to readencoding - the character encoding to usejava.io.IOException
public static java.lang.String getStringFromStream(java.io.InputStream stream)
throws java.io.IOException
stream - the stream to readjava.io.IOException
public static java.lang.String getStringFromStream(java.io.InputStream stream,
java.lang.String encoding)
throws java.io.IOException
stream - the inputstream to readencoding - the encoding to usejava.io.IOException
public static java.lang.String getStringFromStream(java.io.InputStream stream,
java.lang.String encoding,
boolean closeStream)
throws java.io.IOException
stream - the inputstream to readencoding - the encoding to usecloseStream - true to close the streamjava.io.IOException
|
Oracle® WebCenter Content Site Studio for External Applications Java API Reference 11g Release 1 (11.1.1) E17273-03 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||