Package org.smallmind.nutsnbolts.io
Class CircularBuffer
- java.lang.Object
-
- org.smallmind.nutsnbolts.io.CircularBuffer
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class CircularBuffer extends Object implements Closeable
-
-
Constructor Summary
Constructors Constructor Description CircularBuffer(int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleanisClosed()intread(byte[] data)intread(byte[] data, int off, int len)intread(byte[] data, int off, int len, long timeout)intread(byte[] data, long timeout)intreadAvailable()longskip(long len)longskip(long len, long timeout)intwrite(byte[] data)intwrite(byte[] data, int off, int len)intwrite(byte[] data, int off, int len, long timeout)intwrite(byte[] data, long timeout)intwriteAvailable()
-
-
-
Method Detail
-
isClosed
public boolean isClosed()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
readAvailable
public int readAvailable() throws IOException- Throws:
IOException
-
writeAvailable
public int writeAvailable() throws IOException- Throws:
IOException
-
read
public int read(byte[] data) throws IOException, InterruptedException- Throws:
IOExceptionInterruptedException
-
read
public int read(byte[] data, long timeout) throws IOException, InterruptedException- Throws:
IOExceptionInterruptedException
-
read
public int read(byte[] data, int off, int len) throws IOException, InterruptedException- Throws:
IOExceptionInterruptedException
-
read
public int read(byte[] data, int off, int len, long timeout) throws IOException, InterruptedException- Throws:
IOExceptionInterruptedException
-
write
public int write(byte[] data) throws IOException, InterruptedException- Throws:
IOExceptionInterruptedException
-
write
public int write(byte[] data, long timeout) throws IOException, InterruptedException- Throws:
IOExceptionInterruptedException
-
write
public int write(byte[] data, int off, int len) throws IOException, InterruptedException- Throws:
IOExceptionInterruptedException
-
write
public int write(byte[] data, int off, int len, long timeout) throws IOException, InterruptedException- Throws:
IOExceptionInterruptedException
-
skip
public long skip(long len) throws IOException, InterruptedException- Throws:
IOExceptionInterruptedException
-
skip
public long skip(long len, long timeout) throws IOException, InterruptedException- Throws:
IOExceptionInterruptedException
-
-