@Override public void skipWhiteSpace() { try { index = CharScanner.skipWhiteSpace( readBuf, index, length ); if (index >= length && more) { ensureBuffer(); skipWhiteSpace(); } } catch ( Exception ex ) { ex.printStackTrace(); String str = CharScanner.errorDetails ( "skipWhiteSpaceIfNeeded issue", readBuf, index, ch ); Exceptions.handle ( ex, str, "\n\nLENGTH", length, "INDEX", index ); } }
@Override public void skipWhiteSpace() { try { index = CharScanner.skipWhiteSpace( readBuf, index, length ); if (index >= length && more) { ensureBuffer(); skipWhiteSpace(); } } catch ( Exception ex ) { ex.printStackTrace(); String str = CharScanner.errorDetails ( "skipWhiteSpaceIfNeeded issue", readBuf, index, ch ); Exceptions.handle ( ex, str, "\n\nLENGTH", length, "INDEX", index ); } }
@Override public void skipWhiteSpace() { try { index = CharScanner.skipWhiteSpace( readBuf, index, length ); if (index >= length && more) { ensureBuffer(); skipWhiteSpace(); } } catch ( Exception ex ) { ex.printStackTrace(); String str = CharScanner.errorDetails ( "skipWhiteSpaceIfNeeded issue", readBuf, index, ch ); Exceptions.handle ( ex, str, "\n\nLENGTH", length, "INDEX", index ); } }
@Test public void readNumberTest2() { String testString = "123 456"; initSourceWithString(testString); char [] numberChars = source.readNumber(); boolean ok = Chr.equals ( "123".toCharArray (), numberChars ) || die( new String(numberChars) ) ; source.skipWhiteSpace(); numberChars = source.readNumber(); ok = Chr.equals ( "456".toCharArray (), numberChars ) || die( new String(numberChars) ) ; }
@Test public void skipWhiteSpace() { String testString = "a b c"; initSourceWithString(testString); boolean ok = source.nextChar() == 'a' || die("" + (char)source.currentChar()); source.nextChar(); source.skipWhiteSpace(); ok &= source.nextChar() == 'b' || die("$$" + (char)source.currentChar() + "$$"); source.nextChar(); source.skipWhiteSpace(); ok &= source.nextChar() == 'c' || die("" + (char)source.currentChar()); source.skipWhiteSpace(); }