org.apache.commons.io.input |
This package provides implementations of input classes, such as
InputStream and Reader .
|
Java Source File Name | Type | Comment |
ClassLoaderObjectInputStream.java | Class | A special ObjectInputStream that loads a class based on a specified
ClassLoader rather than the system default. |
ClassLoaderObjectInputStreamTest.java | Class | Tests the CountingInputStream. |
CountingInputStream.java | Class | A decorating input stream that counts the number of bytes that have passed
through the stream so far. |
CountingInputStreamTest.java | Class | Tests the CountingInputStream. |
DemuxInputStream.java | Class | Data written to this stream is forwarded to a stream that has been associated
with this thread. |
NullInputStream.java | Class | A functional, light weight
InputStream that emulates
a stream of a specified size.
This implementation provides a light weight
object for testing with an
InputStream where the contents don't matter.
One use case would be for testing the handling of
large
InputStream as it can emulate that
scenario without the overhead of actually processing
large numbers of bytes - significantly speeding up
test execution times.
This implementation returns zero from the method that
reads a byte and leaves the array unchanged in the read
methods that are passed a byte array.
If alternative data is required the processByte() and
processBytes() methods can be implemented to generate
data, for example:
public class TestInputStream extends NullInputStream {
public TestInputStream(int size) {
super(size);
}
protected int processByte() {
return ... |
NullInputStreamTest.java | Class | JUnit Test Case for
NullInputStream . |
NullReader.java | Class | A functional, light weight
Reader that emulates
a reader of a specified size.
This implementation provides a light weight
object for testing with an
Reader where the contents don't matter.
One use case would be for testing the handling of
large
Reader as it can emulate that
scenario without the overhead of actually processing
large numbers of characters - significantly speeding up
test execution times.
This implementation returns a space from the method that
reads a character and leaves the array unchanged in the read
methods that are passed a character array.
If alternative data is required the processChar() and
processChars() methods can be implemented to generate
data, for example:
public class TestReader extends NullReader {
public TestReader(int size) {
super(size);
}
protected char processChar() {
return ... |
NullReaderTest.java | Class | JUnit Test Case for
NullReader . |
PackageTestSuite.java | Class | A basic test suite that tests all the IO input package. |
ProxyInputStream.java | Class | A Proxy stream which acts as expected, that is it passes the method
calls on to the proxied stream and doesn't change which methods are
being called. |
ProxyReader.java | Class | A Proxy stream which acts as expected, that is it passes the method
calls on to the proxied stream and doesn't change which methods are
being called. |
SwappedDataInputStream.java | Class | DataInput for systems relying on little endian data formats.
When read, values will be changed from little endian to big
endian formats for internal usage. |
SwappedDataInputStreamTest.java | Class | Test for the SwappedDataInputStream. |