Package com.sun.xml.ws.util
Class ReadAllStream
java.lang.Object
java.io.InputStream
com.sun.xml.ws.util.ReadAllStream
- All Implemented Interfaces:
Closeable,AutoCloseable
Reads a input stream completely and creates a new stream
by keeping some data in memory and the rest on the file system.
- Author:
- Jitendra Kotamraju
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()intread()intread(byte[] b, int off, int sz) voidreadAll(InputStream in, long inMemory) Reads the data from input stream completely.Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
Constructor Details
-
ReadAllStream
public ReadAllStream()
-
-
Method Details
-
readAll
Reads the data from input stream completely. It keeps inMemory size in the memory, and the rest on the file system. Caller's responsibility to close the InputStream. This method can be called only once.- Parameters:
in- from which to be readinMemory- this much data is kept in the memory- Throws:
IOException- in case of exception
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-