publicclass OverflowInSkip { publicstaticvoid main(String[] args) throws Exception { char[] a = "_123456789_123456789_123456789_123456789"
.toCharArray(); // a.length > 33 try (CharArrayReader car = new CharArrayReader(a)) { long small = 33; long big = Long.MAX_VALUE;
long smallSkip = car.skip(small); if (smallSkip != small) thrownew Exception("Expected to skip " + small
+ " chars, but skipped " + smallSkip);
long expSkip = a.length - small; long bigSkip = car.skip(big); if (bigSkip != expSkip) thrownew Exception("Expected to skip " + expSkip
+ " chars, but skipped " + bigSkip);
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.