All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class org.jos.fs.util.CachedMedium

java.lang.Object
    |
    +----org.jos.fs.util.CachedMedium

public class CachedMedium
extends Object
implements Medium, MediumListener
A cached medium. Can't be distinguished from the underlying medium, but handles most read/write queries much faster by holding temporary copies of medium data in memory.

This is a thread-safe class (as required by org.jos.fs.Medium).

Version:
JOS-FileSystem 4 Preview (25-Mar-98)
Author:
Stefan Reich

Constructor Index

 o CachedMedium(Medium, int, int)

Method Index

 o addMediumListener(MediumListener)
 o eject()
 o flush()
 o getFlags()
 o getSize()
 o isRemoved()
 o mediumEjects(MediumEvent)
 o mediumWillEject(MediumEvent)
 o readBytes(long, byte[], int, int)
 o remount()
 o removeMediumListener(MediumListener)
 o toString()
 o writeBytes(long, byte[], int, int)

Constructors

 o CachedMedium
public CachedMedium(Medium medium,
                    int blockSize,
                    int maxCacheSize)

Methods

 o getFlags
public int getFlags()
 o getSize
public long getSize()
 o readBytes
public void readBytes(long ofs,
                      byte[] buf,
                      int bOfs,
                      int count) throws IOException, IllegalArgumentException
 o writeBytes
public void writeBytes(long ofs,
                       byte[] buf,
                       int bOfs,
                       int count) throws IOException, UnsupportedFeatureException
 o flush
public void flush() throws IOException
 o eject
public void eject() throws VetoException, IOException, UnsupportedFeatureException
 o remount
public void remount() throws IOException, UnsupportedFeatureException
 o isRemoved
public boolean isRemoved()
 o addMediumListener
public void addMediumListener(MediumListener l)
 o removeMediumListener
public void removeMediumListener(MediumListener l)
 o mediumWillEject
public void mediumWillEject(MediumEvent evt) throws VetoException
 o mediumEjects
public void mediumEjects(MediumEvent evt) throws IOException
 o toString
public String toString()
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index