public class MultipartStream.ItemInputStream
extends java.io.InputStream
implements org.apache.commons.fileupload.util.Closeable
An InputStream
for reading an items contents.
Modifier and Type | Method and Description |
---|---|
int |
available()
Returns the number of bytes, which are currently available, without blocking.
|
void |
close()
Closes the input stream.
|
long |
getBytesRead()
Returns the number of bytes, which have been read by the stream.
|
boolean |
isClosed()
Returns, whether the stream is closed.
|
int |
read()
Returns the next byte in the stream.
|
int |
read(byte[] b,
int off,
int len)
Reads bytes into the given buffer.
|
long |
skip(long bytes)
Skips the given number of bytes.
|
public long getBytesRead()
Returns the number of bytes, which have been read by the stream.
public int available() throws java.io.IOException
Returns the number of bytes, which are currently available, without blocking.
available
in class java.io.InputStream
java.io.IOException
- An I/O error occurs.public int read() throws java.io.IOException
Returns the next byte in the stream.
read
in class java.io.InputStream
java.io.IOException
- An I/O error occurred.public int read(byte[] b, int off, int len) throws java.io.IOException
Reads bytes into the given buffer.
read
in class java.io.InputStream
b
- The destination buffer, where to write to.off
- Offset of the first byte in the buffer.len
- Maximum number of bytes to read.java.io.IOException
- An I/O error occurred.public void close() throws java.io.IOException
Closes the input stream.
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
- An I/O error occurred.public long skip(long bytes) throws java.io.IOException
Skips the given number of bytes.
skip
in class java.io.InputStream
bytes
- Number of bytes to skip.java.io.IOException
- An I/O error occurred.public boolean isClosed()
Returns, whether the stream is closed.
Copyright © 2014–2017 ActFramework. All rights reserved.