@Test public void shouldIdentifyDigitsInAsciiCharacters() throws UnsupportedEncodingException { assertTrue("Is a digit", ByteUtil.isAsciiDigit("0".getBytes(StandardCharsets.US_ASCII)[0])); assertTrue("Is a digit", ByteUtil.isAsciiDigit("1".getBytes(StandardCharsets.US_ASCII)[0])); assertTrue("Is a digit", ByteUtil.isAsciiDigit("2".getBytes(StandardCharsets.US_ASCII)[0])); assertTrue("Is a digit", ByteUtil.isAsciiDigit("3".getBytes(StandardCharsets.US_ASCII)[0])); assertTrue("Is a digit", ByteUtil.isAsciiDigit("4".getBytes(StandardCharsets.US_ASCII)[0])); assertTrue("Is a digit", ByteUtil.isAsciiDigit("5".getBytes(StandardCharsets.US_ASCII)[0])); assertTrue("Is a digit", ByteUtil.isAsciiDigit("6".getBytes(StandardCharsets.US_ASCII)[0])); assertTrue("Is a digit", ByteUtil.isAsciiDigit("7".getBytes(StandardCharsets.US_ASCII)[0])); assertTrue("Is a digit", ByteUtil.isAsciiDigit("8".getBytes(StandardCharsets.US_ASCII)[0])); assertTrue("Is a digit", ByteUtil.isAsciiDigit("9".getBytes(StandardCharsets.US_ASCII)[0])); assertFalse("Not a digit", ByteUtil.isAsciiDigit("/".getBytes(StandardCharsets.US_ASCII)[0])); assertFalse("Not a digit", ByteUtil.isAsciiDigit("A".getBytes(StandardCharsets.US_ASCII)[0])); assertFalse("Not a digit", ByteUtil.isAsciiDigit("z".getBytes(StandardCharsets.US_ASCII)[0])); assertFalse("Not a digit", ByteUtil.isAsciiDigit(";".getBytes(StandardCharsets.US_ASCII)[0])); }
public static boolean isAsciiDigit(final byte asciiCharacter) { return asciiCharacter > 47 && asciiCharacter < 58; }
ByteUtil { public static boolean isAsciiDigit(final byte asciiCharacter) { return asciiCharacter > 47 && asciiCharacter < 58; } }
ByteUtil { public static boolean isAsciiDigit(final byte asciiCharacter) { return asciiCharacter > 47 && asciiCharacter < 58; }  }
ByteUtil { public static boolean isAsciiDigit(final byte asciiCharacter) { return asciiCharacter > 47 && asciiCharacter < 58; }  static void writeLongAsAscii(final byte[] outputBuffer, final int offset, final long valueParam); static boolean isAsciiDigit(final byte asciiCharacter); static String formatIntAsIpAddress(final int address); static void formatIntAsIpAddress(final StringBuilder buffer, final int address); static long packLongWithUnsignedShortInts(final int int1, final int int2, final int int3, final int int4); static boolean isEqual(final byte[] lhs, final int lhsOffset, final byte[] rhs, final int rhsOffset, final int length); static int readIntFromAscii(final byte[] asciiBuffer, final int offset, final int length); static long readLongFromAscii(final byte[] asciiBuffer, final int offset, final int length); static boolean isInteger(final byte[] asciiBuffer, final int offset, final int length); static void replace(final byte[] buffer, final int offset, final int length,
                               final byte target, final byte replacement); static void asciiEncode(final CharSequence chars, final int charOffset,
                                   final byte[] buffer, final int bufferOffset, final int length); }
ByteUtil { public static boolean isAsciiDigit(final byte asciiCharacter) { return asciiCharacter > 47 && asciiCharacter < 58; }  static void writeLongAsAscii(final byte[] outputBuffer, final int offset, final long valueParam); static boolean isAsciiDigit(final byte asciiCharacter); static String formatIntAsIpAddress(final int address); static void formatIntAsIpAddress(final StringBuilder buffer, final int address); static long packLongWithUnsignedShortInts(final int int1, final int int2, final int int3, final int int4); static boolean isEqual(final byte[] lhs, final int lhsOffset, final byte[] rhs, final int rhsOffset, final int length); static int readIntFromAscii(final byte[] asciiBuffer, final int offset, final int length); static long readLongFromAscii(final byte[] asciiBuffer, final int offset, final int length); static boolean isInteger(final byte[] asciiBuffer, final int offset, final int length); static void replace(final byte[] buffer, final int offset, final int length,
                               final byte target, final byte replacement); static void asciiEncode(final CharSequence chars, final int charOffset,
                                   final byte[] buffer, final int bufferOffset, final int length); static final int MAX_UNSIGNED_SHORT; }