Class File


  • public class File
    extends Object
    File, which can be used by the flash file system (FFS)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int addr  
      (package private) int[] blocks  
      (package private) byte filler  
      int len  
      String name  
      (package private) boolean valid  
    • Constructor Summary

      Constructors 
      Constructor Description
      File​(String name)
      Creates new file, if file with this name already exists, existing file is deleted first returns null if maximum number of files is exceeded
    • Field Detail

      • len

        public int len
      • filler

        byte filler
      • addr

        int addr
      • blocks

        int[] blocks
      • valid

        boolean valid
    • Constructor Detail

      • File

        public File​(String name)
        Creates new file, if file with this name already exists, existing file is deleted first returns null if maximum number of files is exceeded
        Parameters:
        name - Name of the file
    • Method Detail

      • address

        public int address()
        Returns address of first block of file.
        Returns:
        Address of file.
      • length

        public int length()
        Returns length of file in bytes.
        Returns:
        Length in bytes.
      • register

        public void register()
        Writes file length into directory.
      • delete

        public void delete()
        Deletes file in directory.