public class SynchronizedInputStream extends DecoratingInputStream
InputStream
via an object provided to its constructor.SynchronizedOutputStream| Modifier and Type | Field and Description |
|---|---|
protected java.lang.Object |
lock
The object to synchronize on - never
null. |
delegate| Constructor and Description |
|---|
SynchronizedInputStream(java.io.InputStream in)
Constructs a new synchronized input stream.
|
SynchronizedInputStream(java.io.InputStream in,
java.lang.Object lock)
Constructs a new synchronized input stream.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
void |
mark(int readlimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
long |
skip(long n) |
read, toStringpublic SynchronizedInputStream(java.io.InputStream in)
in - the input stream to wrap in this decorator.public SynchronizedInputStream(java.io.InputStream in,
java.lang.Object lock)
in - the input stream to wrap in this decorator.lock - the object to synchronize on.
If null, then this object is used, not the stream.public int read()
throws java.io.IOException
read in class DecoratingInputStreamjava.io.IOExceptionpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class DecoratingInputStreamjava.io.IOExceptionpublic long skip(long n)
throws java.io.IOException
skip in class DecoratingInputStreamjava.io.IOExceptionpublic int available()
throws java.io.IOException
available in class DecoratingInputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class DecoratingInputStreamjava.io.IOExceptionpublic void mark(int readlimit)
mark in class DecoratingInputStreampublic void reset()
throws java.io.IOException
reset in class DecoratingInputStreamjava.io.IOExceptionpublic boolean markSupported()
markSupported in class DecoratingInputStreamCopyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.