class RLP {

    public static byte[] encodeInt(int singleInt) {
        if (singleInt <= 0xFF)
            return encodeByte((byte) singleInt);
        else if (singleInt <= 0xFFFF)
    		return encodeShort((short) singleInt);
        else if (singleInt <= 0xFFFFFF)
			return new byte[] { (byte) (OFFSET_SHORT_ITEM + 3),
				(byte) (singleInt >>> 16),
				(byte) (singleInt >>> 8),
				(byte) singleInt};
        else {
			return new byte[] { (byte) (OFFSET_SHORT_ITEM + 4),
					(byte) (singleInt >>> 24),
					(byte) (singleInt >>> 16),
					(byte) (singleInt >>> 8),
					(byte) singleInt};
        }
    }

}