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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
int
read()
int
read
(byte[] b, int off, int sz) void
readAll
(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:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-