sys::Obj sys::Virtual sys::FileStore sys::MemoryFileStore
public abstract class MemoryFileStore
A file store implementation where the file contents are backed by an in- memory byte[]. The memory file is modeled by a MemoryFile object. When a sys::File is opened by this file store, the "fp" field of the File will be assigned to a MemoryFile. Therefore, any open memory file can be accessed by casting the fp field of the sys::File to a MemoryFile. Sub-classes must implement the following abstract methods:
int getMemorySize(File f) bool openMemoryFile(MemoryFile m)
public override bool close(File f)
public virtual override void flush(File f)
public abstract int getMemorySize(File f)
Return the size of the memory buffer back the file represented by "f".
public abstract bool openMemoryFile(MemoryFile m)
Given a MemoryFile, the implementation must set the mem byte[] to point to the contents being backed by the memory file. Pre-Condition: all fields of the MemoryFile are initialized except for the mem field. return true on success, false on error.
public virtual override int read(File f)
public virtual override int readBytes(File f, byte[] b, int off, int len)
public virtual override bool seek(File f, int pos)
public override int size(File f)
Must be implemented by getMemorySize(File f)
public virtual override int tell(File f)
public virtual override bool write(File f, int b)
public virtual override bool writeBytes(File f, byte[] b, int off, int len)