Package anlavn.file

Class Raw

java.lang.Object
anlavn.file.Raw

public class Raw extends Object
The Raw class supports write and read string data to file at specific location.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Raw(String filePath)
    Open a Raw File at filePath location.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Use this method to close the file if you don't want write or read to there anymore.
    void
    copyTo(String directory)
    Use this method to copy file to the specified directory.
    void
    copyTo(String directory, int bufferNum)
    Use this method to copy file to the specified directory.
    Use this method to get file location.
    Use this method to read string data from file.
    void
    Use this method to write string Data to file.

    Methods inherited from class java.lang.Object

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

    • Raw

      public Raw(String filePath)
      Open a Raw File at filePath location.
      Parameters:
      filePath - is specific location of Raw file, file name extension should be ".txt".
  • Method Details

    • getFilePath

      public String getFilePath()
      Use this method to get file location.
      Returns:
      location of Raw file.
    • closeFile

      public void closeFile()
      Use this method to close the file if you don't want write or read to there anymore.
    • writeData

      public void writeData(String Data)
      Use this method to write string Data to file.
      Parameters:
      Data - a string data need write to file.
    • readData

      public String readData()
      Use this method to read string data from file.
      Returns:
      a string data in file, return null if nothing.
    • copyTo

      public void copyTo(String directory)
      Use this method to copy file to the specified directory.
      Parameters:
      directory - directory path will contain your file.
    • copyTo

      public void copyTo(String directory, int bufferNum)
      Use this method to copy file to the specified directory.
      Parameters:
      directory - directory path will contain your file.
      bufferNum - number of byte buffer when copy. Default is 8192.