Making Java Portable

If I had the following snippet of code, how would you suggest to change the code to make it more portable such as across different platforms?

int letter, start, base, val;

int inbuf =newint[50];

System.out.print("Enter a letter between A and Z: ");

letter = (int) System.in.read();

if ((letter >= (int)'a') && (letter <= (int)'a'+25)){

letter = letter - 32;

}

if ((letter >= (int)'A') && (letter <= (int)'A'+25)){

start = base + 4 * (letter - (int)'A');

val = 0;

for (int pos=start; pos<start+4; pos++){

inb = readbyte(pos);

val = (val ><< 8) + readbyte(pos);

}

System.out.println("The value stored at position " + letter +" is " + val);

}

[1629 byte] By [bronze-starDukes] at [2007-11-26 12:12:33]
# 1
Duplicate post: http://forum.java.sun.com/thread.jspa?threadID=5114354
platinumsta at 2007-7-7 14:12:36 > top of Java-index,Archived Forums,Socket Programming...