RleProgram.java - import java.util.Scanner; public class...

This preview shows page 1 - 2 out of 5 pages.

The preview shows page 1 - 2 out of 5 pages.
import java.util.Scanner;public class RleProgram {public static void main(String[] args) {Scanner scnr = new Scanner(System.in);boolean menu = true;boolean imageData = false;byte[] encodedData = new byte[180];byte[] decodedData = new byte[800];String rep = "";String flatData = "";System.out.println("Welcome to the RLE image encoder! \n");System.out.println("Displaying Spectrum Image: ");ConsoleGfx.displayImage(ConsoleGfx.testRainbow);while (menu == true) {System.out.println("");System.out.println("RLE Menu ");System.out.println("-------- ");System.out.println("0. Exit ");System.out.println("1. Load File ");System.out.println("2. Load Test Image ");System.out.println("3. Read RLE String ");System.out.println("4. Read RLE Hex String ");System.out.println("5. Read Data Hex String ");System.out.println("6. Display Image ");System.out.println("7. Display RLE String ");System.out.println("8. Display Hex RLE Data ");System.out.println("9. Display Hex Flat Data \n");System.out.print("Select a Menu Option: ");int choice = scnr.nextInt();// byte[] fileData = null;switch(choice) {case 0: {menu = false;break;}case 1: {System.out.print("Enter name of file to load: ");String filename = scnr.next();decodedData = ConsoleGfx.loadFile(filename);imageData = true;break;}case 2: {decodedData = ConsoleGfx.testImage;

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 5 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Spring
Professor
Staff
Tags
public static void, public class RleProgram

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture