class ThreadLocalInputStream
extends java.io.InputStream
Modifier and Type | Field and Description |
---|---|
private java.io.InputStream |
defaultInputStream |
private java.lang.InheritableThreadLocal |
streams
The InputStreams for the various threads
|
Constructor and Description |
---|
ThreadLocalInputStream(java.io.InputStream defaultInputStream) |
Modifier and Type | Method and Description |
---|---|
int |
available() |
void |
close() |
(package private) java.io.InputStream |
getInputStream()
Returns this thread's InputStream
|
(package private) void |
init(java.io.InputStream streamForCurrentThread)
Sets the InputStream for the current thread
|
void |
mark(int readlimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
long |
skip(long n) |
private java.lang.InheritableThreadLocal streams
private java.io.InputStream defaultInputStream
ThreadLocalInputStream(java.io.InputStream defaultInputStream)
defaultInputStream
- the InputStream that will be used if the
current thread has not called init()void init(java.io.InputStream streamForCurrentThread)
streamForCurrentThread
- the InputStream for the current threadjava.io.InputStream getInputStream()
public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
InputStream.available()
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
InputStream.close()
public void mark(int readlimit)
mark
in class java.io.InputStream
InputStream.mark(int)
public boolean markSupported()
markSupported
in class java.io.InputStream
InputStream.markSupported()
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
InputStream.read()
public int read(byte[] b) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
InputStream.read(byte[])
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
InputStream.read(byte[],int,int)
public void reset() throws java.io.IOException
reset
in class java.io.InputStream
java.io.IOException
InputStream.reset()
public long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
java.io.IOException
InputStream.skip(long)