Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package csc143.backmask;
- import java.io.*;
- import java.util.*;
- /**
- * @author Vita Wiebe
- * @version PA6
- * A class which reads the textual input from a DAT file,
- * reverses it, and thereby produces a "backmasked" or "unbackmasked" audio file.
- */
- public class UnBackMasker {
- // Fields:
- // Create new input file, read from input file using Scanner.io or something
- // Declare only, take out initialization
- private File inFile;
- //PrintWriter or PrintStream for output file (written to)
- private File outFile;
- /**
- * Class constructor.
- * Will do the "work" of reversing the appropriate info from the source
- * file and writing it to the output file.
- * Returns a "backwards" version of the .dat file we originally input.
- * @param File inFile, the file to be opened and read from.
- * @param File outFile, the file to be created and written to from input.
- * @return A .dat file with the displacement info written in opposite order
- */
- public UnBackMasker(File inFile, File outFile) {
- // Get input file (to be read from)
- // Open input file
- // Create output file (to be written to)
- // Write headers from inFile to outFile directly
- // Write time column from inFile to queue
- // Read from queue into outFile to recreate time column in same order
- // Write displacement column from inFile to stack
- // Read displacements from stack and write into outFile
- // (this will cause them to be in reverse order)
- // Close input file (don't forget)
- }
- /**
- * Will accept user input into args array,
- * use these Strings to specify an input file to read from
- * and an output file to write to, then uses these
- * files as arguments "in" and "out" to the class
- * constructor's respective "inFile" and "outFile" params.
- */
- public static void main(String[] args) {
- File in;
- File out;
- // Main report # of args errors,
- // UnBackMasker report "file not found" errors, System.err useage
- //Scanner scan = new Scanner(System.in);
- if (args.length != 2) {
- throw new IllegalArgumentException("Only accepts two arguments.");
- }else{
- //while (scan.hasNext()) {
- in = new File(args[0]);
- out = new File(in, args[1]);
- new UnBackMasker(in, out);
- // }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement