Please am new to java and i need an assistant on loading hexadecimal from a textfile and converting it into binary(Loader class) then the binary will be kept in another class(memory class). then the binary will be forwarded to another output file.

Recommended Answers

All 2 Replies

Well you would want to first use some fileIO to get in data (link), then after getting the values of the numbers you convert the string of hex to binary with this code

    int hex = Integer.parseInt("0x00ff00", 16);//parses integer to base 16 (hexadecimal)
    String binary = Integer.toBinaryString(i); //converts hex number to binary
    System.out.println(binary);  //prints binary string

and then just write it to a file. :)

DaniWeb Member Rules (which you agreed to when you signed up) include:
"Do provide evidence of having done some work yourself if posting questions from school or work assignments"

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.