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.InputStreamjava.io.IOExceptionInputStream.available()public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjava.io.IOExceptionInputStream.close()public void mark(int readlimit)
mark in class java.io.InputStreamInputStream.mark(int)public boolean markSupported()
markSupported in class java.io.InputStreamInputStream.markSupported()public int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionInputStream.read()public int read(byte[] b)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionInputStream.read(byte[])public int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionInputStream.read(byte[],int,int)public void reset()
throws java.io.IOException
reset in class java.io.InputStreamjava.io.IOExceptionInputStream.reset()public long skip(long n)
throws java.io.IOException
skip in class java.io.InputStreamjava.io.IOExceptionInputStream.skip(long)