Class MultipartStream.ItemInputStream
- java.lang.Object
- 
- java.io.InputStream
- 
- org.apache.tomcat.util.http.fileupload.MultipartStream.ItemInputStream
 
 
- 
- All Implemented Interfaces:
- java.io.Closeable,- java.lang.AutoCloseable,- Closeable
 - Enclosing class:
- MultipartStream
 
 public class MultipartStream.ItemInputStream extends java.io.InputStream implements Closeable AnInputStreamfor reading an items contents.
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()Returns the number of bytes, which are currently available, without blocking.voidclose()Closes the input stream.voidclose(boolean pCloseUnderlying)Closes the input stream.longgetBytesRead()Returns the number of bytes, which have been read by the stream.booleanisClosed()Returns, whether the stream is closed.intread()Returns the next byte in the stream.intread(byte[] b, int off, int len)Reads bytes into the given buffer.longskip(long bytes)Skips the given number of bytes.
 
- 
- 
- 
Method Detail- 
getBytesReadpublic long getBytesRead() Returns the number of bytes, which have been read by the stream.- Returns:
- Number of bytes, which have been read so far.
 
 - 
availablepublic int available() throws java.io.IOExceptionReturns the number of bytes, which are currently available, without blocking.- Overrides:
- availablein class- java.io.InputStream
- Returns:
- Number of bytes in the buffer.
- Throws:
- java.io.IOException- An I/O error occurs.
 
 - 
readpublic int read() throws java.io.IOExceptionReturns the next byte in the stream.- Specified by:
- readin class- java.io.InputStream
- Returns:
- The next byte in the stream, as a non-negative integer, or -1 for EOF.
- Throws:
- java.io.IOException- An I/O error occurred.
 
 - 
readpublic int read(byte[] b, int off, int len) throws java.io.IOExceptionReads bytes into the given buffer.- Overrides:
- readin class- java.io.InputStream
- Parameters:
- b- The destination buffer, where to write to.
- off- Offset of the first byte in the buffer.
- len- Maximum number of bytes to read.
- Returns:
- Number of bytes, which have been actually read, or -1 for EOF.
- Throws:
- java.io.IOException- An I/O error occurred.
 
 - 
closepublic void close() throws java.io.IOExceptionCloses the input stream.
 - 
closepublic void close(boolean pCloseUnderlying) throws java.io.IOExceptionCloses the input stream.- Parameters:
- pCloseUnderlying- Whether to close the underlying stream (hard close)
- Throws:
- java.io.IOException- An I/O error occurred.
 
 - 
skippublic long skip(long bytes) throws java.io.IOExceptionSkips the given number of bytes.- Overrides:
- skipin class- java.io.InputStream
- Parameters:
- bytes- Number of bytes to skip.
- Returns:
- The number of bytes, which have actually been skipped.
- Throws:
- java.io.IOException- An I/O error occurred.
 
 
- 
 
-