uk.ac.rdg.resc.jstyx.gridservice.client
Class CachedStreamReader

java.lang.Object
  extended by uk.ac.rdg.resc.jstyx.gridservice.server.GeneralCachingStreamReader
      extended by uk.ac.rdg.resc.jstyx.gridservice.client.CachedStreamReader

public class CachedStreamReader
extends GeneralCachingStreamReader

Reads a CStyxFileInputStream and caches the results locally, allowing multiple windows to be opened on the same data feed whilst saving network traffic

Author:
Jon Blower $Revision: 377 $ $Date: 2005-08-31 18:03:19 +0100 (Wed, 31 Aug 2005) $ $Log$ Revision 1.4 2005/08/31 17:03:19 jonblower Renamed "StyxFile*putStream*" to "CStyxFile*putStream*" for consistency with CStyxFile class Revision 1.3 2005/06/07 16:44:45 jonblower Fixed problem with caching stream reader on client side Revision 1.2 2005/05/27 21:22:39 jonblower Further development of caching stream readers Revision 1.1 2005/05/27 17:02:59 jonblower Initial import

Nested Class Summary
 
Nested classes/interfaces inherited from class uk.ac.rdg.resc.jstyx.gridservice.server.GeneralCachingStreamReader
GeneralCachingStreamReader.DataRequest
 
Constructor Summary
CachedStreamReader(CStyxFile stream)
           
 
Method Summary
 void error(GeneralCachingStreamReader.DataRequest originalRequest, java.lang.Exception e)
           
 java.lang.String getName()
           
 void newData(GeneralCachingStreamReader.DataRequest originalRequest, byte[] data, int offset, int count)
           
 void read(StreamViewer viewer, long offset, int count)
           
 void start()
          Starts reading from the stream.
 
Methods inherited from class uk.ac.rdg.resc.jstyx.gridservice.server.GeneralCachingStreamReader
delete, getCacheFile, getCacheLength, isEOF, read, setCacheFile, startReading
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedStreamReader

public CachedStreamReader(CStyxFile stream)
                   throws java.io.IOException
Throws:
java.io.IOException
Method Detail

start

public void start()
           throws java.io.IOException
Starts reading from the stream. Does nothing if already started.

Throws:
java.io.IOException

read

public void read(StreamViewer viewer,
                 long offset,
                 int count)

newData

public void newData(GeneralCachingStreamReader.DataRequest originalRequest,
                    byte[] data,
                    int offset,
                    int count)
Specified by:
newData in class GeneralCachingStreamReader

error

public void error(GeneralCachingStreamReader.DataRequest originalRequest,
                  java.lang.Exception e)
Specified by:
error in class GeneralCachingStreamReader

getName

public java.lang.String getName()


Copyright © 2004-2006 Reading e-Science Centre. All Rights Reserved.