Package xyz.cofe.cbuffer
Class ContentBufferOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- xyz.cofe.cbuffer.ContentBufferOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class ContentBufferOutputStream extends OutputStream
Создает stream для записи- Author:
- user
-
-
Field Summary
Fields Modifier and Type Field Description protected longbeginIndexprotected ContentBuffercontentBufferprotected longendIndexExclusiveprotected Locklockprotected longpointer
-
Constructor Summary
Constructors Constructor Description ContentBufferOutputStream(ContentBuffer buffer)ContentBufferOutputStream(ContentBuffer buffer, long beginIndex)ContentBufferOutputStream(ContentBuffer buffer, long beginIndex, long endIndexExclusive)ContentBufferOutputStream(ContentBuffer buffer, long beginIndex, long endIndexExclusive, Lock lock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()voidwrite(byte[] b)voidwrite(byte[] b, int off, int len)voidwrite(int b)-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Field Detail
-
lock
protected Lock lock
-
contentBuffer
protected ContentBuffer contentBuffer
-
beginIndex
protected long beginIndex
-
endIndexExclusive
protected long endIndexExclusive
-
pointer
protected long pointer
-
-
Constructor Detail
-
ContentBufferOutputStream
public ContentBufferOutputStream(ContentBuffer buffer, long beginIndex, long endIndexExclusive, Lock lock)
-
ContentBufferOutputStream
public ContentBufferOutputStream(ContentBuffer buffer, long beginIndex, long endIndexExclusive)
-
ContentBufferOutputStream
public ContentBufferOutputStream(ContentBuffer buffer, long beginIndex)
-
ContentBufferOutputStream
public ContentBufferOutputStream(ContentBuffer buffer)
-
-
Method Detail
-
write
public void write(int b) throws IOException- Specified by:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
-