Package jpigpio

Class FileIO

java.lang.Object
jpigpio.FileIO

public class FileIO
extends java.lang.Object
A helper class for some simple file I/O activities.
  • Constructor Summary

    Constructors 
    Constructor Description
    FileIO​(java.io.File file)
    Constructor to create a wrapper to the file.
  • Method Summary

    Modifier and Type Method Description
    void close()
    Close the file.
    byte[] read​(int size)
    Read up to

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FileIO

      public FileIO​(java.io.File file)
      Constructor to create a wrapper to the file.
      Parameters:
      file - The file to be accessed.
  • Method Details

    • read

      public byte[] read​(int size) throws java.io.IOException
      Read up to
      size
      bytes from the file.
      Parameters:
      size - The maximum size of data to return
      Returns:
      An array of data. It may be zero length if there is no data available.
      Throws:
      java.io.IOException - on IO Exception :-)
    • close

      public void close() throws java.io.IOException
      Close the file.
      Throws:
      java.io.IOException - on IO Exception :-)