Package org.jgroups.blocks
Class GridOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.jgroups.blocks.GridOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class GridOutputStream extends java.io.OutputStream
-
-
Field Summary
Fields Modifier and Type Field Description (package private) ReplCache<java.lang.String,byte[]>cache(package private) intchunk_size(package private) byte[]current_bufferprotected GridFilefile(package private) intindex(package private) intlocal_index(package private) static Loglog(package private) java.lang.Stringname(package private) shortrepl_count
-
Constructor Summary
Constructors Constructor Description GridOutputStream(GridFile file, boolean append, ReplCache<java.lang.String,byte[]> cache, short repl_count, int chunk_size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()private intgetBytesRemainingInChunk()private intgetChunkNumber()private voidreset()voidwrite(byte[] b)voidwrite(byte[] b, int off, int len)voidwrite(int b)
-
-
-
Field Detail
-
cache
final ReplCache<java.lang.String,byte[]> cache
-
repl_count
final short repl_count
-
chunk_size
final int chunk_size
-
name
final java.lang.String name
-
file
protected final GridFile file
-
index
int index
-
local_index
int local_index
-
current_buffer
final byte[] current_buffer
-
log
static final Log log
-
-
Method Detail
-
write
public void write(int b) throws java.io.IOException- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] b) throws java.io.IOException- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] b, int off, int len) throws java.io.IOException- Overrides:
writein classjava.io.OutputStream- 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.OutputStream- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.OutputStream- Throws:
java.io.IOException
-
getBytesRemainingInChunk
private int getBytesRemainingInChunk()
-
getChunkNumber
private int getChunkNumber()
-
reset
private void reset()
-
-