Java Reference
In-Depth Information
For a hint, see Programming Exercise 4.46. Write a program that prompts the
user to enter a file name, reads bytes from the file, and displays each byte's
binary representation.
*19.19
( View hex ) Write a program that prompts the user to enter a file name, reads
bytes from the file, and displays each byte's hex representation. ( Hint : You can
first convert the byte value into an 8-bit string, then convert the bit string into a
two-digit hex string.)
**19.20
( Binary editor ) Write a GUI application that lets the user enter a file name in the
text field and press the Enter key to display its binary representation in a text
area. The user can also modify the binary code and save it back to the file, as
shown in Figure 19.22a.
(a)
(b)
F IGURE 19.22 The programs enable the user to manipulate the contents of the file in
(a) binary and (b) hex.
**19.21
( Hex editor ) Write a GUI application that lets the user enter a file name in the
text field and press the Enter key to display its hex representation in a text
area. The user can also modify the hex code and save it back to the file, as
shown in Figure 19.22b.
 
 
Search WWH ::




Custom Search