Methods Summary |
---|
public void | close()
flushBefore(length());
super.close();
ramc.close();
|
public void | flushBefore(long pos)
long flushedPosition = getFlushedPosition();
super.flushBefore(pos);
long newFlushedPosition = getFlushedPosition();
int nBytes = (int)(newFlushedPosition - flushedPosition);
ramc.getData(os, nBytes, flushedPosition);
ramc.freeBefore(newFlushedPosition);
os.flush();
|
public boolean | isCached()
return true;
|
public boolean | isCachedFile()
return false;
|
public boolean | isCachedMemory()
return true;
|
public long | length()
return ramc.length();
|
public int | read()
bitOffset = 0;
int res = ramc.getData(streamPos);
if (res >= 0) {
streamPos++;
}
return res;
|
public int | read(byte[] b, int off, int len)
bitOffset = 0;
int res = ramc.getData(b, off, len, streamPos);
if (res > 0) {
streamPos += res;
}
return res;
|
public void | write(int b)
flushBits(); // See the flushBits method description
ramc.putData(b, streamPos);
streamPos++;
|
public void | write(byte[] b, int off, int len)
flushBits(); // See the flushBits method description
ramc.putData(b, off, len, streamPos);
streamPos += len;
|