Package xyz.cofe.cbuffer
Class ContentBufferInputStream
- java.lang.Object
-
- java.io.InputStream
-
- xyz.cofe.cbuffer.ContentBufferInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class ContentBufferInputStream extends InputStream
Чтение из буфера- Author:
- user
-
-
Field Summary
Fields Modifier and Type Field Description protected longbeginIndexprotected ContentBuffercontentBufferprotected longendIndexExclusiveprotected Locklockprotected longpointer
-
Constructor Summary
Constructors Constructor Description ContentBufferInputStream(ContentBuffer buffer)КонструкторContentBufferInputStream(ContentBuffer buffer, long beginIndex)КонструкторContentBufferInputStream(ContentBuffer buffer, long beginIndex, long endIndexExclusive)КонструкторContentBufferInputStream(ContentBuffer buffer, long beginIndex, long endIndexExclusive, Lock lock)Конструктор
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()intread()intread(byte[] b)intread(byte[] b, int off, int len)longskip(long n)-
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, transferTo
-
-
-
-
Field Detail
-
lock
protected Lock lock
-
contentBuffer
protected ContentBuffer contentBuffer
-
beginIndex
protected long beginIndex
-
endIndexExclusive
protected long endIndexExclusive
-
pointer
protected long pointer
-
-
Constructor Detail
-
ContentBufferInputStream
public ContentBufferInputStream(ContentBuffer buffer, long beginIndex, long endIndexExclusive, Lock lock)
Конструктор- Parameters:
buffer- буфферbeginIndex- начальный индексendIndexExclusive- конечный индекс или -1lock- блокировка или null
-
ContentBufferInputStream
public ContentBufferInputStream(ContentBuffer buffer, long beginIndex, long endIndexExclusive)
Конструктор- Parameters:
buffer- буфферbeginIndex- начальный индексendIndexExclusive- конечный индекс или -1
-
ContentBufferInputStream
public ContentBufferInputStream(ContentBuffer buffer, long beginIndex)
Конструктор- Parameters:
buffer- буфферbeginIndex- начальный индекс
-
ContentBufferInputStream
public ContentBufferInputStream(ContentBuffer buffer)
Конструктор- Parameters:
buffer- буффер
-
-
Method Detail
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
skip
public long skip(long n) throws IOException- Overrides:
skipin classInputStream- Throws:
IOException
-
-