Package org.jgroups.blocks
Class GridInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.jgroups.blocks.GridInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class GridInputStream extends java.io.InputStream
-
-
Field Summary
Fields Modifier and Type Field Description (package private) ReplCache<java.lang.String,byte[]>cache(package private) intchunk_size(package private) byte[]current_buffer(package private) booleanend_reachedprotected GridFilefile(package private) intindex(package private) intlocal_index(package private) static Loglog(package private) java.lang.Stringname
-
Constructor Summary
Constructors Constructor Description GridInputStream(GridFile file, ReplCache<java.lang.String,byte[]> cache, int chunk_size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()private byte[]fetchNextChunk()private intgetBytesRemainingInChunk()private intgetChunkNumber()intread()intread(byte[] b)intread(byte[] b, int off, int len)longskip(long n)
-
-
-
Field Detail
-
cache
final ReplCache<java.lang.String,byte[]> cache
-
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
byte[] current_buffer
-
end_reached
boolean end_reached
-
log
static final Log log
-
-
Method Detail
-
read
public int read() throws java.io.IOException- Specified by:
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
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException- Overrides:
readin 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
-
available
public int available() throws java.io.IOException- Overrides:
availablein 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
-
getBytesRemainingInChunk
private int getBytesRemainingInChunk()
-
fetchNextChunk
private byte[] fetchNextChunk()
-
getChunkNumber
private int getChunkNumber()
-
-