Board Prototype

Attention : Programming, Development, Edtior check content blog in Main. Error be no Running.

Friday, November 21, 2025

[JAVA] HEX EDIT

import java.io.FileInputStream;
import java.io.IOException;

public class HexViewer {
    public static void main(String[] args) {
        String filePath = "yourfile.bin";
        try (FileInputStream fis = new FileInputStream(filePath)) {
            int b;
            while ((b = fis.read()) != -1) {
                // Convert byte to hex string (ensure two digits)
                String hex = String.format("%02X", (byte) b);
                System.out.print(hex + " ");
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

No comments: