166167168169170171172173174175176
int pos = 0; try { ios.mark(); do { if (pos >= length) { ios.reset(); ios.mark(); pos = 0; } ios.write(0); pos++;
176177178179180181182183184185186
pos++; } while (--numReps >= 0); } catch (IOException e) { e.printStackTrace(); } finally { try { ios.reset(); } catch (IOException e) {} } } } private static class IOSWriteByteArray extends OutputStreamTests {
206207208209210211212213214215216
int pos = 0; try { ios.mark(); do { if (pos + scanlineStride > length) { ios.reset(); ios.mark(); pos = 0; } ios.write(buf); pos += scanlineStride;
216217218219220221222223224225226
pos += scanlineStride; } while (--numReps >= 0); } catch (IOException e) { e.printStackTrace(); } finally { try { ios.reset(); } catch (IOException e) {} } } } private static class IOSWriteBit extends OutputStreamTests {
244245246247248249250251252253254
int pos = 0; // measured in bits try { ios.mark(); do { if (pos >= length) { ios.reset(); ios.mark(); pos = 0; } ios.writeBit(0); pos++;
254255256257258259260261262263264
pos++; } while (--numReps >= 0); } catch (IOException e) { e.printStackTrace(); } finally { try { ios.reset(); } catch (IOException e) {} } } } private static class IOSWriteByte extends OutputStreamTests {
282283284285286287288289290291292
int pos = 0; try { ios.mark(); do { if (pos >= length) { ios.reset(); ios.mark(); pos = 0; } ios.writeByte(0); pos++;
292293294295296297298299300301302
pos++; } while (--numReps >= 0); } catch (IOException e) { e.printStackTrace(); } finally { try { ios.reset(); } catch (IOException e) {} } } } private static class IOSWriteShort extends OutputStreamTests {
320321322323324325326327328329330
int pos = 0; try { ios.mark(); do { if (pos + 2 > length) { ios.reset(); ios.mark(); pos = 0; } ios.writeShort(0); pos += 2;
330331332333334335336337338339340
pos += 2; } while (--numReps >= 0); } catch (IOException e) { e.printStackTrace(); } finally { try { ios.reset(); } catch (IOException e) {} } } } private static class IOSWriteInt extends OutputStreamTests {