View Single Post
Old 05-08-2007, 03:12 PM   #7
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
Code:
package com.irex.sdk;

import java.io.FileInputStream;
import java.io.PrintStream;

public class HelloWorld
{

    public HelloWorld()
    {
    }

    public static void main(String args[])
    {
        try
        {
            byte abyte0[] = new byte[12];
            char c = '\u0106';
            FileInputStream fileinputstream = new FileInputStream("ROOTDIR/proc/sysset/raw");
            byte abyte1[] = new byte[c + 6];
            int i = fileinputstream.read(abyte1);
            System.out.println("read:" + i + " bytes");
            for(int j = 0; j < 6; j++)
            {
                byte byte0 = abyte1[c + j];
                int k = byte0 >>> 4 & 0xf;
                int l = byte0 & 0xf;
                char c1 = Character.forDigit(k, 16);
                char c2 = Character.forDigit(l, 16);
                System.out.println(j + "=" + abyte1[c + j] + ",(" + k + "," + l + "),char=[" + c1 + "," + c2 + "]");
            }

        }
        catch(Exception exception)
        {
            exception.printStackTrace();
        }
    }
}
scotty1024 is offline   Reply With Quote