Java tutorial
//package com.java2s; public class Main { public static int osType(String type) { int result; result = (type.charAt(0) & 0xff) << 24; result |= (type.charAt(1) & 0xff) << 16; result |= (type.charAt(2) & 0xff) << 8; result |= (type.charAt(3) & 0xff); return result; } }