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
public class ReadAllStream extends InputStream
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 Constructor Description ReadAllStream()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()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
-
-
-
-
Method Detail
-
readAll
public void readAll(InputStream in, long inMemory) throws IOException
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
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int sz) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
-