Sky View Café - Java

org.shetline.io
Class ResourceInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.shetline.io.ResourceInputStream
All Implemented Interfaces:
Closeable

public class ResourceInputStream
extends InputStream


Field Summary
protected static String altWebHost
           
protected static boolean AS_RESOURCE
           
protected static boolean getFilesAsResources
           
protected  InputStream itsStream
           
protected static String rootPath
           
protected static Applet theApplet
           
 
Constructor Summary
ResourceInputStream(String filePath)
           
ResourceInputStream(String filePath, Class resourceOwnerClass)
           
 
Method Summary
 int available()
           
 void close()
           
protected  String extendFilePath(String filePath)
           
protected  String extendFilePath(String filePath, boolean asResource)
           
protected  InputStream getStreamForResource(String filePath, Class resourceOwnerClass)
           
 InputStream getUnderlyingStream()
           
 void mark(int readLimit)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int offset, int length)
           
 void reset()
           
static void setAlternateWebHost(String webHost)
           
static void setApplet(Applet anApplet)
           
static void setRootPath(String newRootPath)
           
 long skip(long n)
           
static void useFilesFromResources(boolean state)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

itsStream

protected InputStream itsStream

rootPath

protected static String rootPath

getFilesAsResources

protected static boolean getFilesAsResources

theApplet

protected static Applet theApplet

altWebHost

protected static String altWebHost

AS_RESOURCE

protected static final boolean AS_RESOURCE
See Also:
Constant Field Values
Constructor Detail

ResourceInputStream

public ResourceInputStream(String filePath)
                    throws FileNotFoundException
Throws:
FileNotFoundException

ResourceInputStream

public ResourceInputStream(String filePath,
                           Class resourceOwnerClass)
                    throws FileNotFoundException
Throws:
FileNotFoundException
Method Detail

getStreamForResource

protected InputStream getStreamForResource(String filePath,
                                           Class resourceOwnerClass)

getUnderlyingStream

public InputStream getUnderlyingStream()

setRootPath

public static void setRootPath(String newRootPath)

setApplet

public static void setApplet(Applet anApplet)

setAlternateWebHost

public static void setAlternateWebHost(String webHost)

useFilesFromResources

public static void useFilesFromResources(boolean state)

extendFilePath

protected String extendFilePath(String filePath)

extendFilePath

protected String extendFilePath(String filePath,
                                boolean asResource)

available

public int available()
              throws IOException
Overrides:
available in class InputStream
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException

mark

public void mark(int readLimit)
Overrides:
mark in class InputStream

markSupported

public boolean markSupported()
Overrides:
markSupported in class InputStream

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b,
                int offset,
                int length)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

reset

public void reset()
           throws IOException
Overrides:
reset in class InputStream
Throws:
IOException

skip

public long skip(long n)
          throws IOException
Overrides:
skip in class InputStream
Throws:
IOException

Sky View Café - Java