public int parseInt(int start, int end) { return parseInt(start, end, 10); }
public int parseInt(int start, int end) { return parseInt(start, end, 10); }
@Override public int convertToInt(CharSequence value) { if (value instanceof AsciiString) { return ((AsciiString) value).parseInt(); } return Integer.parseInt(value.toString()); }
public int parseInt(int start, int end) { return parseInt(start, end, 10); }
@Override public int convertToInt(CharSequence value) { if (value instanceof AsciiString) { return ((AsciiString) value).parseInt(); } return Integer.parseInt(value.toString()); }
public int parseInt(int radix) { return parseInt(0, length(), radix); }
public int parseInt() { return parseInt(0, length(), 10); }
@Override public int convertToInt(CharSequence value) { if (value instanceof AsciiString) { return ((AsciiString) value).parseInt(); } return Integer.parseInt(value.toString()); }
public short parseShort(int start, int end, int radix) { int intValue = parseInt(start, end, radix); short result = (short) intValue; if (result != intValue) { throw new NumberFormatException(subSequence(start, end, false).toString()); } return result; }
public int parseInt() { return parseInt(0, length(), 10); }
public int parseInt(int radix) { return parseInt(0, length(), radix); }
public int parseInt(int start, int end, int radix) { if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) { throw new NumberFormatException(); } if (start == end) { throw new NumberFormatException(); } int i = start; boolean negative = byteAt(i) == '-'; if (negative && ++i == end) { throw new NumberFormatException(subSequence(start, end, false).toString()); } return parseInt(i, end, radix, negative); }
public int parseInt() { return parseInt(0, length(), 10); }
public short parseShort(int start, int end, int radix) { int intValue = parseInt(start, end, radix); short result = (short) intValue; if (result != intValue) { throw new NumberFormatException(subSequence(start, end, false).toString()); } return result; }
public int parseInt(int radix) { return parseInt(0, length(), radix); }
public int parseInt(int start, int end, int radix) { if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) { throw new NumberFormatException(); } if (start == end) { throw new NumberFormatException(); } int i = start; boolean negative = byteAt(i) == '-'; if (negative && ++i == end) { throw new NumberFormatException(subSequence(start, end, false).toString()); } return parseInt(i, end, radix, negative); }
public short parseShort(int start, int end, int radix) { int intValue = parseInt(start, end, radix); short result = (short) intValue; if (result != intValue) { throw new NumberFormatException(subSequence(start, end, false).toString()); } return result; }
public int parseInt(int start, int end, int radix) { if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) { throw new NumberFormatException(); } if (start == end) { throw new NumberFormatException(); } int i = start; boolean negative = byteAt(i) == '-'; if (negative && ++i == end) { throw new NumberFormatException(subSequence(start, end, false).toString()); } return parseInt(i, end, radix, negative); }
/** * Parses the specified HTTP status line into a {@link HttpResponseStatus}. The expected formats of the line are: * <ul> * <li>{@code statusCode} (e.g. 200)</li> * <li>{@code statusCode} {@code reasonPhrase} (e.g. 404 Not Found)</li> * </ul> * * @throws IllegalArgumentException if the specified status line is malformed */ public static HttpResponseStatus parseLine(AsciiString line) { try { int space = line.forEachByte(FIND_ASCII_SPACE); return space == -1 ? valueOf(line.parseInt()) : valueOf(line.parseInt(0, space), line.toString(space + 1)); } catch (Exception e) { throw new IllegalArgumentException("malformed status line: " + line, e); } }
public short parseShort(int start, int end, int radix) { int intValue = parseInt(start, end, radix); short result = (short) intValue; if (result != intValue) { throw new NumberFormatException(subSequence(start, end, false).toString()); } return result; }