org.freehep.application
Class StoppableInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.freehep.application.StoppableInputStream
- All Implemented Interfaces:
- Closeable, BoundedRangeModel, Stoppable
public class StoppableInputStream
- extends FilterInputStream
- implements Stoppable, BoundedRangeModel
An input stream which also implements Stoppable. Useful when downloading
files in order to provide the user with feedback on progress.
- Version:
- $Id: StoppableInputStream.java 8584 2006-08-10 23:06:37Z duns $
- Author:
- Tony Johnson (tonyj@slac.stanford.edu)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StoppableInputStream
public StoppableInputStream(URL url)
throws IOException
- Throws:
IOException
StoppableInputStream
public StoppableInputStream(InputStream in,
int length)
getModel
public BoundedRangeModel getModel()
- Specified by:
getModel
in interface Stoppable
stop
public void stop()
- Specified by:
stop
in interface Stoppable
read
public int read(byte[] b)
throws IOException
- Overrides:
read
in class FilterInputStream
- Throws:
IOException
read
public int read()
throws IOException
- Overrides:
read
in class FilterInputStream
- Throws:
IOException
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Overrides:
read
in class FilterInputStream
- Throws:
IOException
skip
public long skip(long n)
throws IOException
- Overrides:
skip
in class FilterInputStream
- Throws:
IOException
reset
public void reset()
throws IOException
- Overrides:
reset
in class FilterInputStream
- Throws:
IOException
mark
public void mark(int readlimit)
- Overrides:
mark
in class FilterInputStream
addChangeListener
public void addChangeListener(ChangeListener x)
- Specified by:
addChangeListener
in interface BoundedRangeModel
removeChangeListener
public void removeChangeListener(ChangeListener x)
- Specified by:
removeChangeListener
in interface BoundedRangeModel
getExtent
public int getExtent()
- Specified by:
getExtent
in interface BoundedRangeModel
getMaximum
public int getMaximum()
- Specified by:
getMaximum
in interface BoundedRangeModel
getMinimum
public int getMinimum()
- Specified by:
getMinimum
in interface BoundedRangeModel
getValue
public int getValue()
- Specified by:
getValue
in interface BoundedRangeModel
getValueIsAdjusting
public boolean getValueIsAdjusting()
- Specified by:
getValueIsAdjusting
in interface BoundedRangeModel
setExtent
public void setExtent(int newExtent)
- Specified by:
setExtent
in interface BoundedRangeModel
setMaximum
public void setMaximum(int newMaximum)
- Specified by:
setMaximum
in interface BoundedRangeModel
setMinimum
public void setMinimum(int newMinimum)
- Specified by:
setMinimum
in interface BoundedRangeModel
setRangeProperties
public void setRangeProperties(int value,
int extent,
int min,
int max,
boolean adjusting)
- Specified by:
setRangeProperties
in interface BoundedRangeModel
setValue
public void setValue(int newValue)
- Specified by:
setValue
in interface BoundedRangeModel
setValueIsAdjusting
public void setValueIsAdjusting(boolean b)
- Specified by:
setValueIsAdjusting
in interface BoundedRangeModel
Copyright © 2000-2006 FreeHEP. All Rights Reserved.