com.sun.xml.ws.util
Class ReadAllStream

java.lang.Object
  extended by java.io.InputStream
      extended by com.sun.xml.ws.util.ReadAllStream
All Implemented Interfaces:
java.io.Closeable

public class ReadAllStream
extends java.io.InputStream

Reads a input stream completely and creates a new stream by keeping some data in memory and the rest on the file system.


Constructor Summary
ReadAllStream()
           
 
Method Summary
 void close()
           
 int read()
           
 int read(byte[] b, int off, int sz)
           
 void readAll(java.io.InputStream in, long inMemory)
          Reads the data from input stream completely.
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadAllStream

public ReadAllStream()
Method Detail

readAll

public void readAll(java.io.InputStream in,
                    long inMemory)
             throws java.io.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 read
inMemory - this much data is kept in the memory
Throws:
java.io.IOException - in case of exception

read

public int read()
         throws java.io.IOException
Specified by:
read in class java.io.InputStream
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int sz)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.InputStream
Throws:
java.io.IOException


Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.