publicstaticvoid main(String[] args) throws Exception { long skipped = 0;
// Create a tiny buffered stream so it can be easily // set up to contain only some of the bytes to skip
DataSupplier source = new DataSupplier();
BufferedInputStream in = new BufferedInputStream(source, 4);
// Set up data to be skipped and recovered // the skip must be longer than the buffer size
in.mark(30); while (skipped < 15) {
skipped += in.skip(15-skipped);
} int nextint = in.read();
in.reset();
// Resume reading and see if data was lost
nextint = in.read();
if (nextint != 'a') thrownew RuntimeException("BufferedInputStream skip lost data");
}
}
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.