DCT Lightfoot v3 API specification

com.dctl.hardware.flash
Class FlashFileInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--com.dctl.hardware.flash.FlashFileInputStream
All Implemented Interfaces:
Readable

public class FlashFileInputStream
extends InputStream

Flash file input stream that allows input operations to take place on a flash file


Constructor Summary
FlashFileInputStream(FlashFile file)
          Create a new input stream from a file
FlashFileInputStream(java.lang.String name)
          Create a new input stream from a file
 
Method Summary
 int available()
          Return how many bytes can be read - this is the remaining length of the file
 void close()
          Close the file
 void mark(int readlimit)
          Mark the current location
 boolean markSupported()
          Test if mark supported
 int read()
          Read a byte from the file
 int read(byte[] buf, int offset, int length)
          Read from the file into a buffer
 void reset()
          Reset to the previous marked location
 int skip(int amount)
          Skip a number of bytes
 
Methods inherited from class java.io.InputStream
read, skip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlashFileInputStream

public FlashFileInputStream(FlashFile file)
                     throws IOException
Create a new input stream from a file

Parameters:
file - The flash file
Throws:
IOException - if there is an error creating the file

FlashFileInputStream

public FlashFileInputStream(java.lang.String name)
                     throws IOException
Create a new input stream from a file

Parameters:
name - The name of the file
Throws:
IOException - if there is an error creating the file
Method Detail

close

public void close()
Close the file

Overrides:
close in class InputStream

read

public int read()
         throws IOException
Read a byte from the file

Specified by:
read in interface Readable
Specified by:
read in class InputStream
Returns:
the byte
Throws:
IOException - if there is an error

read

public int read(byte[] buf,
                int offset,
                int length)
         throws IOException
Read from the file into a buffer

Specified by:
read in interface Readable
Overrides:
read in class InputStream
Parameters:
buf - The buffer
offset - The offset into the buffer
length - The number of bytes to read
Returns:
the number of bytes read, 0 for a closed file
Throws:
IOException - if there is an error

skip

public int skip(int amount)
         throws IOException
Skip a number of bytes

Parameters:
amount - The number of bytes to skip
Returns:
the number of bytes skipped
Throws:
IOException - if there is an error

available

public int available()
              throws IOException
Return how many bytes can be read - this is the remaining length of the file

Overrides:
available in class InputStream
Returns:
the number of bytes
Throws:
IOException - if there is an error

mark

public void mark(int readlimit)
Mark the current location

Overrides:
mark in class InputStream
Parameters:
readlimit - Ignored

markSupported

public boolean markSupported()
Test if mark supported

Overrides:
markSupported in class InputStream
Returns:
true

reset

public void reset()
           throws IOException
Reset to the previous marked location

Overrides:
reset in class InputStream
Throws:
IOException - if there is an error

DCT Lightfoot v3 API specification

DCT Lightfoot v3 API specification