Package xyz.cofe.cbuffer
Class ContentBufferInputStream
java.lang.Object
java.io.InputStream
xyz.cofe.cbuffer.ContentBufferInputStream
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class ContentBufferInputStream
extends java.io.InputStream
Чтение из буфера
- Author:
- user
-
Field Summary
Fields Modifier and Type Field Description protected longbeginIndexprotected ContentBuffercontentBufferprotected longendIndexExclusiveprotected java.util.concurrent.locks.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, java.util.concurrent.locks.Lock lock)Конструктор -
Method Summary
-
Field Details
-
lock
protected java.util.concurrent.locks.Lock lock -
contentBuffer
-
beginIndex
protected long beginIndex -
endIndexExclusive
protected long endIndexExclusive -
pointer
protected long pointer
-
-
Constructor Details
-
ContentBufferInputStream
public ContentBufferInputStream(ContentBuffer buffer, long beginIndex, long endIndexExclusive, java.util.concurrent.locks.Lock lock)Конструктор- Parameters:
buffer- буфферbeginIndex- начальный индексendIndexExclusive- конечный индекс или -1lock- блокировка или null
-
ContentBufferInputStream
Конструктор- Parameters:
buffer- буфферbeginIndex- начальный индексendIndexExclusive- конечный индекс или -1
-
ContentBufferInputStream
Конструктор- Parameters:
buffer- буфферbeginIndex- начальный индекс
-
ContentBufferInputStream
Конструктор- Parameters:
buffer- буффер
-
-
Method Details
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOException- Overrides:
skipin classjava.io.InputStream- Throws:
java.io.IOException
-