@Test public void testParseInt() { int int1 = 0; byte[] bytes1 = Double.toString(int1).getBytes(); assertEquals(int1, NumberUtil.parseInt(bytes1, 0, bytes1.length)); int int2 = -7; byte[] bytes2 = Double.toString(int2).getBytes(); assertEquals(int2, NumberUtil.parseInt(bytes2, 0, bytes2.length)); int int3 = +128; byte[] bytes3 = Double.toString(int3).getBytes(); assertEquals(int3, NumberUtil.parseInt(bytes3, 0, bytes3.length)); int int4 = 4; byte[] bytes4 = Double.toString(int4).getBytes(); assertEquals(int4, NumberUtil.parseInt(bytes4, 0, bytes4.length)); byte[] bytes5 = "0123-456789".getBytes(); assertEquals(-456, NumberUtil.parseInt(bytes5, 4, 4)); }
public static int parseInt(byte[] bytes, int start, int length) { return parseInt(bytes, start, length, 10); }
NumberUtil { public static int parseInt(byte[] bytes, int start, int length) { return parseInt(bytes, start, length, 10); } }
NumberUtil { public static int parseInt(byte[] bytes, int start, int length) { return parseInt(bytes, start, length, 10); }  }
NumberUtil { public static int parseInt(byte[] bytes, int start, int length) { return parseInt(bytes, start, length, 10); }  static long unsigned32(int n); static int unsigned16(short n); static byte[] toAsciiBytes(Number i); static byte[] toAsciiBytes(short i); static byte[] toAsciiBytes(int i); static byte[] toAsciiBytes(long i); static byte[] toAsciiBytes(float i); static byte[] toAsciiBytes(double i); static double parseDouble(byte[] bytes, int start, int length); static int parseInt(byte[] bytes, int start, int length); static int parseInt(byte[] bytes, int start, int length, int radix); static long parseLong(byte[] bytes, int start, int length); static long parseLong(byte[] bytes, int start, int length, int radix); static void writeUTF8(OutputStream out, int i); static void writeUTF8(OutputStream out, long i); static double parseDouble(ByteBuf bytes); static double parseDouble(ByteBuf bytes, int start, int length); static int parseInt(ByteBuf bytes); static int parseInt(ByteBuf bytes, int start, int length); static int parseInt(ByteBuf bytes, int start, int length, int radix); static long parseLong(ByteBuf bytes); static long parseLong(ByteBuf bytes, int start, int length); static long parseLong(ByteBuf bytes, int start, int length, int radix); static Number numberValue(Class<?> numberClazz, String value); static int compare(long x, long y); static int putBytes(byte[] tgtBytes, int tgtOffset, byte[] srcBytes,
                             int srcOffset, int srcLength); static byte[] toBytes(ByteBuffer buf); static byte[] toBytes(String s); static byte [] toBytes(final boolean b); static boolean toBoolean(final byte [] b); static byte[] toBytes(long val); static long toLong(byte[] bytes); static long toLong(byte[] bytes, int offset); static long toLong(byte[] bytes, int offset, final int length); static int putLong(byte[] bytes, int offset, long val); static float toFloat(byte [] bytes); static float toFloat(byte [] bytes, int offset); static int putFloat(byte [] bytes, int offset, float f); static byte [] toBytes(final float f); static double toDouble(final byte [] bytes); static double toDouble(final byte [] bytes, final int offset); static int putDouble(byte [] bytes, int offset, double d); static byte [] toBytes(final double d); static byte[] toBytes(int val); static int toInt(byte[] bytes); static int toInt(byte[] bytes, int offset); static int toInt(byte[] bytes, int offset, final int length); static int readAsInt(byte[] bytes, int offset, final int length); static int putInt(byte[] bytes, int offset, int val); static byte[] toBytes(short val); static short toShort(byte[] bytes); static short toShort(byte[] bytes, int offset); static short toShort(byte[] bytes, int offset, final int length); static byte[] getBytes(ByteBuffer buf); static int putShort(byte[] bytes, int offset, short val); static int putAsShort(byte[] bytes, int offset, int val); static byte[] toBytes(BigDecimal val); static BigDecimal toBigDecimal(byte[] bytes); static BigDecimal toBigDecimal(byte[] bytes, int offset, final int length); static int putBigDecimal(byte[] bytes, int offset, BigDecimal val); }
NumberUtil { public static int parseInt(byte[] bytes, int start, int length) { return parseInt(bytes, start, length, 10); }  static long unsigned32(int n); static int unsigned16(short n); static byte[] toAsciiBytes(Number i); static byte[] toAsciiBytes(short i); static byte[] toAsciiBytes(int i); static byte[] toAsciiBytes(long i); static byte[] toAsciiBytes(float i); static byte[] toAsciiBytes(double i); static double parseDouble(byte[] bytes, int start, int length); static int parseInt(byte[] bytes, int start, int length); static int parseInt(byte[] bytes, int start, int length, int radix); static long parseLong(byte[] bytes, int start, int length); static long parseLong(byte[] bytes, int start, int length, int radix); static void writeUTF8(OutputStream out, int i); static void writeUTF8(OutputStream out, long i); static double parseDouble(ByteBuf bytes); static double parseDouble(ByteBuf bytes, int start, int length); static int parseInt(ByteBuf bytes); static int parseInt(ByteBuf bytes, int start, int length); static int parseInt(ByteBuf bytes, int start, int length, int radix); static long parseLong(ByteBuf bytes); static long parseLong(ByteBuf bytes, int start, int length); static long parseLong(ByteBuf bytes, int start, int length, int radix); static Number numberValue(Class<?> numberClazz, String value); static int compare(long x, long y); static int putBytes(byte[] tgtBytes, int tgtOffset, byte[] srcBytes,
                             int srcOffset, int srcLength); static byte[] toBytes(ByteBuffer buf); static byte[] toBytes(String s); static byte [] toBytes(final boolean b); static boolean toBoolean(final byte [] b); static byte[] toBytes(long val); static long toLong(byte[] bytes); static long toLong(byte[] bytes, int offset); static long toLong(byte[] bytes, int offset, final int length); static int putLong(byte[] bytes, int offset, long val); static float toFloat(byte [] bytes); static float toFloat(byte [] bytes, int offset); static int putFloat(byte [] bytes, int offset, float f); static byte [] toBytes(final float f); static double toDouble(final byte [] bytes); static double toDouble(final byte [] bytes, final int offset); static int putDouble(byte [] bytes, int offset, double d); static byte [] toBytes(final double d); static byte[] toBytes(int val); static int toInt(byte[] bytes); static int toInt(byte[] bytes, int offset); static int toInt(byte[] bytes, int offset, final int length); static int readAsInt(byte[] bytes, int offset, final int length); static int putInt(byte[] bytes, int offset, int val); static byte[] toBytes(short val); static short toShort(byte[] bytes); static short toShort(byte[] bytes, int offset); static short toShort(byte[] bytes, int offset, final int length); static byte[] getBytes(ByteBuffer buf); static int putShort(byte[] bytes, int offset, short val); static int putAsShort(byte[] bytes, int offset, int val); static byte[] toBytes(BigDecimal val); static BigDecimal toBigDecimal(byte[] bytes); static BigDecimal toBigDecimal(byte[] bytes, int offset, final int length); static int putBigDecimal(byte[] bytes, int offset, BigDecimal val); static final double[] powersOf10; static final String UTF8_ENCODING; static final Charset UTF8_CHARSET; static final int SIZEOF_BOOLEAN; static final int SIZEOF_BYTE; static final int SIZEOF_CHAR; static final int SIZEOF_DOUBLE; static final int SIZEOF_FLOAT; static final int SIZEOF_INT; static final int SIZEOF_LONG; static final int SIZEOF_SHORT; }