Advertisement
Vita_Harvey

UnBackMasker_A

Feb 17th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.39 KB | None | 0 0
  1. package csc143.backmask;
  2.  
  3.  
  4. import java.io.*;
  5. import java.util.*;
  6.  
  7. /**
  8.  * @author Vita Wiebe
  9.  * @version PA6
  10.  * A class which reads the textual input from a DAT file,
  11.  * reverses it, and thereby produces a "backmasked" or "unbackmasked" audio file.
  12.  */
  13. public class UnBackMasker {
  14.  
  15.    // Fields:
  16.    // Create new input file, read from input file using Scanner.io or something
  17.    // Declare only, take out initialization
  18.    private File inFile;
  19.    //PrintWriter or PrintStream for output file (written to)
  20.    private File outFile;
  21.    
  22.    /**
  23.     * Class constructor.
  24.     * Will do the "work" of reversing the appropriate info from the source
  25.     * file and writing it to the output file.
  26.     * Returns a "backwards" version of the .dat file we originally input.
  27.     * @param File inFile, the file to be opened and read from.
  28.     * @param File outFile, the file to be created and written to from input.
  29.     * @return A .dat file with the displacement info written in opposite order
  30.     */
  31.    public UnBackMasker(File inFile, File outFile) {
  32.    
  33.    // Get input file (to be read from)
  34.    // Open input file
  35.    // Create output file (to be written to)
  36.    // Write headers from inFile to outFile directly
  37.    // Write time column from inFile to queue
  38.    // Read from queue into outFile to recreate time column in same order
  39.    // Write displacement column from inFile to stack
  40.    // Read displacements from stack and write into outFile
  41.    //    (this will cause them to be in reverse order)
  42.    
  43.    // Close input file (don't forget)
  44.    
  45.    }
  46.    
  47.    /**
  48.     * Will accept user input into args array,
  49.     * use these Strings to specify an input file to read from
  50.     * and an output file to write to, then uses these
  51.     * files as arguments "in" and "out" to the class
  52.     * constructor's respective "inFile" and "outFile" params.
  53.     */
  54.    public static void main(String[] args) {
  55.    
  56.       File in;
  57.       File out;
  58.      
  59.       // Main report # of args errors,
  60.       // UnBackMasker report "file not found" errors, System.err useage
  61.       //Scanner scan = new Scanner(System.in);
  62.       if (args.length != 2) {
  63.          throw new IllegalArgumentException("Only accepts two arguments.");
  64.       }else{
  65.          //while (scan.hasNext()) {
  66.             in = new File(args[0]);
  67.             out = new File(in, args[1]);
  68.             new UnBackMasker(in, out);
  69.         // }
  70.       }    
  71.    }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement