@ThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public class SynchronizedInputStream extends DecoratingInputStream
InputStream
via an object provided to its constructor.SynchronizedOutputStream| Modifier and Type | Field and Description |
|---|---|
protected Object |
lock
The object to synchronize on - never
null. |
delegate| Constructor and Description |
|---|
SynchronizedInputStream(InputStream in)
Constructs a new synchronized input stream.
|
SynchronizedInputStream(InputStream in,
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, toStringprotected final Object lock
null.public SynchronizedInputStream(@Nullable InputStream in)
in - the input stream to wrap in this decorator.public SynchronizedInputStream(@Nullable InputStream in, @CheckForNull 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 available()
throws IOException
available in class DecoratingInputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class DecoratingInputStreamIOExceptionpublic void mark(int readlimit)
mark in class DecoratingInputStreampublic boolean markSupported()
markSupported in class DecoratingInputStreampublic int read()
throws IOException
read in class DecoratingInputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class DecoratingInputStreamIOExceptionpublic void reset()
throws IOException
reset in class DecoratingInputStreamIOExceptionpublic long skip(long n)
throws IOException
skip in class DecoratingInputStreamIOExceptionCopyright © 2004-2011 Schlichtherle IT Services. All Rights Reserved.