@ThreadSafe public class LockInputStream extends DecoratingInputStream
LockOutputStream| Modifier and Type | Field and Description |
|---|---|
protected Lock |
lock
The object to synchronize on.
|
delegate| Constructor and Description |
|---|
LockInputStream(InputStream in,
Lock 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 Lock lock
@CreatesObligation public LockInputStream(@Nullable@WillCloseWhenClosed InputStream in, Lock lock)
in - the input stream to wrap in this decorator.lock - the object to synchronize on.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 © 2005-2013 Schlichtherle IT Services. All Rights Reserved.