org.priha.core.binary
Class FileBinarySource

java.lang.Object
  extended by org.priha.core.binary.FileBinarySource
All Implemented Interfaces:
BinarySource

public class FileBinarySource
extends java.lang.Object
implements BinarySource

Represents a BinarySource which is backed by a File on the Filesystem itself.


Constructor Summary
FileBinarySource(java.io.File f)
           
 
Method Summary
 FileBinarySource clone()
          Duplicates the BinarySource object.
 long getLength()
          Return the length of the object represented by this BinarySource.
 java.io.InputStream getStream()
          Returns the contents of the BinarySource as an InputStream.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileBinarySource

public FileBinarySource(java.io.File f)
Method Detail

getLength

public long getLength()
Description copied from interface: BinarySource
Return the length of the object represented by this BinarySource.

Specified by:
getLength in interface BinarySource
Returns:
The length of the object.

getStream

public java.io.InputStream getStream()
                              throws java.io.FileNotFoundException
Description copied from interface: BinarySource
Returns the contents of the BinarySource as an InputStream. Note that this must always return a valid stream pointing at the beginning of the binary object.

Specified by:
getStream in interface BinarySource
Returns:
An InputStream representing the binary item.
Throws:
java.io.FileNotFoundException

clone

public FileBinarySource clone()
Description copied from interface: BinarySource
Duplicates the BinarySource object.

Specified by:
clone in interface BinarySource
Overrides:
clone in class java.lang.Object
Returns:
A new BinarySource which represents the same object.