Package org.apache.catalina.util
Class IOTools
java.lang.Object
org.apache.catalina.util.IOTools
Contains commonly needed I/O-related methods
- Author:
- Dan Sandberg
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidflow(InputStream is, OutputStream os) Read input from input stream and write it to output stream until there is no more input from input stream using a new buffer of the default size (4 KiB).static voidRead input from reader and write it to writer until there is no more input from reader.static voidRead input from reader and write it to writer until there is no more input from reader.static intreadFully(InputStream is, byte[] buf) Read until EOF or the buffer is filled.
- 
Field Details- 
DEFAULT_BUFFER_SIZEprotected static final int DEFAULT_BUFFER_SIZE- See Also:
 
 
- 
- 
Method Details- 
flowRead input from reader and write it to writer until there is no more input from reader.- Parameters:
- reader- the reader to read from.
- writer- the writer to write to.
- buf- the char array to use as a buffer
- Throws:
- IOException- IO error
 
- 
flowRead input from reader and write it to writer until there is no more input from reader.- Parameters:
- reader- the reader to read from.
- writer- the writer to write to.
- Throws:
- IOException- IO error
- See Also:
 
- 
flowRead input from input stream and write it to output stream until there is no more input from input stream using a new buffer of the default size (4 KiB).- Parameters:
- is- input stream the input stream to read from.
- os- output stream the output stream to write to.
- Throws:
- IOException- If an I/O error occurs during the copy
 
- 
readFullyRead until EOF or the buffer is filled.- Parameters:
- is- The source to read from
- buf- The buffer to write to
- Returns:
- The number of bytes read
- Throws:
- IOException- If an I/O error occurs during the read
 
 
-