net.netheos.pcsapi.bytesio
Class FileByteSource

java.lang.Object
  extended by net.netheos.pcsapi.bytesio.FileByteSource
All Implemented Interfaces:
ByteSource

public class FileByteSource
extends Object
implements ByteSource

Implementation of ByteSource with file


Constructor Summary
FileByteSource(File file)
           
FileByteSource(String fileName)
           
 
Method Summary
 long length()
          Return length of stream (must be known before consuming stream)
 InputStream openStream()
          Returns a ByteSourceStream object for reading data, to be closed by caller
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileByteSource

public FileByteSource(String fileName)

FileByteSource

public FileByteSource(File file)
Method Detail

openStream

public InputStream openStream()
                       throws FileNotFoundException
Description copied from interface: ByteSource
Returns a ByteSourceStream object for reading data, to be closed by caller

Specified by:
openStream in interface ByteSource
Returns:
the underlying stream
Throws:
FileNotFoundException

length

public long length()
Description copied from interface: ByteSource
Return length of stream (must be known before consuming stream)

Specified by:
length in interface ByteSource
Returns:
The stream bytes count

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014. All Rights Reserved.