Package org.apache.axiom.ext.io
Interface ReadFromSupport
- All Known Implementing Classes:
BAAOutputStream,BlobOutputStream
public interface ReadFromSupport
Optional interface implemented by
OutputStream implementations that support
transferring data from an InputStream. This interface may be used to avoid allocating
a temporary buffer when there is a need to copy data from an input stream to an output stream.-
Method Summary
Modifier and TypeMethodDescriptionlongreadFrom(InputStream inputStream, long length) Read data from the given input stream and write it to this output stream.
-
Method Details
-
readFrom
Read data from the given input stream and write it to this output stream. The method transfers data until one of the following conditions is met:- The end of the input stream is reached.
- The value of the
lengthargument is different from-1and the number of bytes transferred is equal tolength.
- Parameters:
inputStream- An input stream to read data from. This method will not close the stream.length- the number of bytes to transfer, or-1if the method should transfer data until the end of the input stream is reached- Returns:
- the number of bytes transferred
- Throws:
StreamCopyException
-