@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, toString
protected 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 DecoratingInputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class DecoratingInputStream
IOException
public void mark(int readlimit)
mark
in class DecoratingInputStream
public boolean markSupported()
markSupported
in class DecoratingInputStream
public int read() throws IOException
read
in class DecoratingInputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class DecoratingInputStream
IOException
public void reset() throws IOException
reset
in class DecoratingInputStream
IOException
public long skip(long n) throws IOException
skip
in class DecoratingInputStream
IOException
Copyright © 2005–2018 Schlichtherle IT Services. All rights reserved.