ThresholdingOutputStream.html 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!-- NewPage -->
  3. <html lang="de">
  4. <head>
  5. <!-- Generated by javadoc -->
  6. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  7. <title>ThresholdingOutputStream (Apache Commons IO 2.6 API)</title>
  8. <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
  9. <script type="text/javascript" src="../../../../../script.js"></script>
  10. </head>
  11. <body>
  12. <script type="text/javascript"><!--
  13. try {
  14. if (location.href.indexOf('is-external=true') == -1) {
  15. parent.document.title="ThresholdingOutputStream (Apache Commons IO 2.6 API)";
  16. }
  17. }
  18. catch(err) {
  19. }
  20. //-->
  21. var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":6,"i5":10,"i6":10,"i7":10,"i8":10,"i9":6,"i10":10,"i11":10,"i12":10};
  22. var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],8:["t4","Concrete Methods"]};
  23. var altColor = "altColor";
  24. var rowColor = "rowColor";
  25. var tableTab = "tableTab";
  26. var activeTableTab = "activeTableTab";
  27. </script>
  28. <noscript>
  29. <div>JavaScript is disabled on your browser.</div>
  30. </noscript>
  31. <!-- ========= START OF TOP NAVBAR ======= -->
  32. <div class="topNav"><a name="navbar.top">
  33. <!-- -->
  34. </a>
  35. <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
  36. <a name="navbar.top.firstrow">
  37. <!-- -->
  38. </a>
  39. <ul class="navList" title="Navigation">
  40. <li><a href="../../../../../overview-summary.html">Overview</a></li>
  41. <li><a href="package-summary.html">Package</a></li>
  42. <li class="navBarCell1Rev">Class</li>
  43. <li><a href="class-use/ThresholdingOutputStream.html">Use</a></li>
  44. <li><a href="package-tree.html">Tree</a></li>
  45. <li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
  46. <li><a href="../../../../../index-all.html">Index</a></li>
  47. <li><a href="../../../../../help-doc.html">Help</a></li>
  48. </ul>
  49. </div>
  50. <div class="subNav">
  51. <ul class="navList">
  52. <li><a href="../../../../../org/apache/commons/io/output/TeeOutputStream.html" title="class in org.apache.commons.io.output"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  53. <li><a href="../../../../../org/apache/commons/io/output/WriterOutputStream.html" title="class in org.apache.commons.io.output"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  54. </ul>
  55. <ul class="navList">
  56. <li><a href="../../../../../index.html?org/apache/commons/io/output/ThresholdingOutputStream.html" target="_top">Frames</a></li>
  57. <li><a href="ThresholdingOutputStream.html" target="_top">No&nbsp;Frames</a></li>
  58. </ul>
  59. <ul class="navList" id="allclasses_navbar_top">
  60. <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
  61. </ul>
  62. <div>
  63. <script type="text/javascript"><!--
  64. allClassesLink = document.getElementById("allclasses_navbar_top");
  65. if(window==top) {
  66. allClassesLink.style.display = "block";
  67. }
  68. else {
  69. allClassesLink.style.display = "none";
  70. }
  71. //-->
  72. </script>
  73. </div>
  74. <div>
  75. <ul class="subNavList">
  76. <li>Summary:&nbsp;</li>
  77. <li>Nested&nbsp;|&nbsp;</li>
  78. <li>Field&nbsp;|&nbsp;</li>
  79. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  80. <li><a href="#method.summary">Method</a></li>
  81. </ul>
  82. <ul class="subNavList">
  83. <li>Detail:&nbsp;</li>
  84. <li>Field&nbsp;|&nbsp;</li>
  85. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  86. <li><a href="#method.detail">Method</a></li>
  87. </ul>
  88. </div>
  89. <a name="skip.navbar.top">
  90. <!-- -->
  91. </a></div>
  92. <!-- ========= END OF TOP NAVBAR ========= -->
  93. <!-- ======== START OF CLASS DATA ======== -->
  94. <div class="header">
  95. <div class="subTitle">org.apache.commons.io.output</div>
  96. <h2 title="Class ThresholdingOutputStream" class="title">Class ThresholdingOutputStream</h2>
  97. </div>
  98. <div class="contentContainer">
  99. <ul class="inheritance">
  100. <li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
  101. <li>
  102. <ul class="inheritance">
  103. <li><a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">java.io.OutputStream</a></li>
  104. <li>
  105. <ul class="inheritance">
  106. <li>org.apache.commons.io.output.ThresholdingOutputStream</li>
  107. </ul>
  108. </li>
  109. </ul>
  110. </li>
  111. </ul>
  112. <div class="description">
  113. <ul class="blockList">
  114. <li class="blockList">
  115. <dl>
  116. <dt>All Implemented Interfaces:</dt>
  117. <dd><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/io/Flushable.html?is-external=true" title="class or interface in java.io">Flushable</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a></dd>
  118. </dl>
  119. <dl>
  120. <dt>Direct Known Subclasses:</dt>
  121. <dd><a href="../../../../../org/apache/commons/io/output/DeferredFileOutputStream.html" title="class in org.apache.commons.io.output">DeferredFileOutputStream</a></dd>
  122. </dl>
  123. <hr>
  124. <br>
  125. <pre>public abstract class <span class="typeNameLabel">ThresholdingOutputStream</span>
  126. extends <a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a></pre>
  127. <div class="block">An output stream which triggers an event when a specified number of bytes of
  128. data have been written to it. The event can be used, for example, to throw
  129. an exception if a maximum has been reached, or to switch the underlying
  130. stream type when the threshold is exceeded.
  131. <p>
  132. This class overrides all <code>OutputStream</code> methods. However, these
  133. overrides ultimately call the corresponding methods in the underlying output
  134. stream implementation.
  135. <p>
  136. NOTE: This implementation may trigger the event <em>before</em> the threshold
  137. is actually reached, since it triggers when a pending write operation would
  138. cause the threshold to be exceeded.</div>
  139. </li>
  140. </ul>
  141. </div>
  142. <div class="summary">
  143. <ul class="blockList">
  144. <li class="blockList">
  145. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  146. <ul class="blockList">
  147. <li class="blockList"><a name="constructor.summary">
  148. <!-- -->
  149. </a>
  150. <h3>Constructor Summary</h3>
  151. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
  152. <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
  153. <tr>
  154. <th class="colOne" scope="col">Constructor and Description</th>
  155. </tr>
  156. <tr class="altColor">
  157. <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/output/ThresholdingOutputStream.html#ThresholdingOutputStream-int-">ThresholdingOutputStream</a></span>(int&nbsp;threshold)</code>
  158. <div class="block">Constructs an instance of this class which will trigger an event at the
  159. specified threshold.</div>
  160. </td>
  161. </tr>
  162. </table>
  163. </li>
  164. </ul>
  165. <!-- ========== METHOD SUMMARY =========== -->
  166. <ul class="blockList">
  167. <li class="blockList"><a name="method.summary">
  168. <!-- -->
  169. </a>
  170. <h3>Method Summary</h3>
  171. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  172. <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
  173. <tr>
  174. <th class="colFirst" scope="col">Modifier and Type</th>
  175. <th class="colLast" scope="col">Method and Description</th>
  176. </tr>
  177. <tr id="i0" class="altColor">
  178. <td class="colFirst"><code>protected void</code></td>
  179. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/output/ThresholdingOutputStream.html#checkThreshold-int-">checkThreshold</a></span>(int&nbsp;count)</code>
  180. <div class="block">Checks to see if writing the specified number of bytes would cause the
  181. configured threshold to be exceeded.</div>
  182. </td>
  183. </tr>
  184. <tr id="i1" class="rowColor">
  185. <td class="colFirst"><code>void</code></td>
  186. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/output/ThresholdingOutputStream.html#close--">close</a></span>()</code>
  187. <div class="block">Closes this output stream and releases any system resources associated
  188. with this stream.</div>
  189. </td>
  190. </tr>
  191. <tr id="i2" class="altColor">
  192. <td class="colFirst"><code>void</code></td>
  193. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/output/ThresholdingOutputStream.html#flush--">flush</a></span>()</code>
  194. <div class="block">Flushes this output stream and forces any buffered output bytes to be
  195. written out.</div>
  196. </td>
  197. </tr>
  198. <tr id="i3" class="rowColor">
  199. <td class="colFirst"><code>long</code></td>
  200. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/output/ThresholdingOutputStream.html#getByteCount--">getByteCount</a></span>()</code>
  201. <div class="block">Returns the number of bytes that have been written to this output stream.</div>
  202. </td>
  203. </tr>
  204. <tr id="i4" class="altColor">
  205. <td class="colFirst"><code>protected abstract <a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a></code></td>
  206. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/output/ThresholdingOutputStream.html#getStream--">getStream</a></span>()</code>
  207. <div class="block">Returns the underlying output stream, to which the corresponding
  208. <code>OutputStream</code> methods in this class will ultimately delegate.</div>
  209. </td>
  210. </tr>
  211. <tr id="i5" class="rowColor">
  212. <td class="colFirst"><code>int</code></td>
  213. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/output/ThresholdingOutputStream.html#getThreshold--">getThreshold</a></span>()</code>
  214. <div class="block">Returns the threshold, in bytes, at which an event will be triggered.</div>
  215. </td>
  216. </tr>
  217. <tr id="i6" class="altColor">
  218. <td class="colFirst"><code>boolean</code></td>
  219. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/output/ThresholdingOutputStream.html#isThresholdExceeded--">isThresholdExceeded</a></span>()</code>
  220. <div class="block">Determines whether or not the configured threshold has been exceeded for
  221. this output stream.</div>
  222. </td>
  223. </tr>
  224. <tr id="i7" class="rowColor">
  225. <td class="colFirst"><code>protected void</code></td>
  226. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/output/ThresholdingOutputStream.html#resetByteCount--">resetByteCount</a></span>()</code>
  227. <div class="block">Resets the byteCount to zero.</div>
  228. </td>
  229. </tr>
  230. <tr id="i8" class="altColor">
  231. <td class="colFirst"><code>protected void</code></td>
  232. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/output/ThresholdingOutputStream.html#setByteCount-long-">setByteCount</a></span>(long&nbsp;count)</code>
  233. <div class="block">Sets the byteCount to count.</div>
  234. </td>
  235. </tr>
  236. <tr id="i9" class="rowColor">
  237. <td class="colFirst"><code>protected abstract void</code></td>
  238. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/output/ThresholdingOutputStream.html#thresholdReached--">thresholdReached</a></span>()</code>
  239. <div class="block">Indicates that the configured threshold has been reached, and that a
  240. subclass should take whatever action necessary on this event.</div>
  241. </td>
  242. </tr>
  243. <tr id="i10" class="altColor">
  244. <td class="colFirst"><code>void</code></td>
  245. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/output/ThresholdingOutputStream.html#write-byte:A-">write</a></span>(byte[]&nbsp;b)</code>
  246. <div class="block">Writes <code>b.length</code> bytes from the specified byte array to this
  247. output stream.</div>
  248. </td>
  249. </tr>
  250. <tr id="i11" class="rowColor">
  251. <td class="colFirst"><code>void</code></td>
  252. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/output/ThresholdingOutputStream.html#write-byte:A-int-int-">write</a></span>(byte[]&nbsp;b,
  253. int&nbsp;off,
  254. int&nbsp;len)</code>
  255. <div class="block">Writes <code>len</code> bytes from the specified byte array starting at
  256. offset <code>off</code> to this output stream.</div>
  257. </td>
  258. </tr>
  259. <tr id="i12" class="altColor">
  260. <td class="colFirst"><code>void</code></td>
  261. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/output/ThresholdingOutputStream.html#write-int-">write</a></span>(int&nbsp;b)</code>
  262. <div class="block">Writes the specified byte to this output stream.</div>
  263. </td>
  264. </tr>
  265. </table>
  266. <ul class="blockList">
  267. <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
  268. <!-- -->
  269. </a>
  270. <h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
  271. <code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
  272. </ul>
  273. </li>
  274. </ul>
  275. </li>
  276. </ul>
  277. </div>
  278. <div class="details">
  279. <ul class="blockList">
  280. <li class="blockList">
  281. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  282. <ul class="blockList">
  283. <li class="blockList"><a name="constructor.detail">
  284. <!-- -->
  285. </a>
  286. <h3>Constructor Detail</h3>
  287. <a name="ThresholdingOutputStream-int-">
  288. <!-- -->
  289. </a>
  290. <ul class="blockListLast">
  291. <li class="blockList">
  292. <h4>ThresholdingOutputStream</h4>
  293. <pre>public&nbsp;ThresholdingOutputStream(int&nbsp;threshold)</pre>
  294. <div class="block">Constructs an instance of this class which will trigger an event at the
  295. specified threshold.</div>
  296. <dl>
  297. <dt><span class="paramLabel">Parameters:</span></dt>
  298. <dd><code>threshold</code> - The number of bytes at which to trigger an event.</dd>
  299. </dl>
  300. </li>
  301. </ul>
  302. </li>
  303. </ul>
  304. <!-- ============ METHOD DETAIL ========== -->
  305. <ul class="blockList">
  306. <li class="blockList"><a name="method.detail">
  307. <!-- -->
  308. </a>
  309. <h3>Method Detail</h3>
  310. <a name="write-int-">
  311. <!-- -->
  312. </a>
  313. <ul class="blockList">
  314. <li class="blockList">
  315. <h4>write</h4>
  316. <pre>public&nbsp;void&nbsp;write(int&nbsp;b)
  317. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  318. <div class="block">Writes the specified byte to this output stream.</div>
  319. <dl>
  320. <dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
  321. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true#write-int-" title="class or interface in java.io">write</a></code>&nbsp;in class&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a></code></dd>
  322. <dt><span class="paramLabel">Parameters:</span></dt>
  323. <dd><code>b</code> - The byte to be written.</dd>
  324. <dt><span class="throwsLabel">Throws:</span></dt>
  325. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an error occurs.</dd>
  326. </dl>
  327. </li>
  328. </ul>
  329. <a name="write-byte:A-">
  330. <!-- -->
  331. </a>
  332. <ul class="blockList">
  333. <li class="blockList">
  334. <h4>write</h4>
  335. <pre>public&nbsp;void&nbsp;write(byte[]&nbsp;b)
  336. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  337. <div class="block">Writes <code>b.length</code> bytes from the specified byte array to this
  338. output stream.</div>
  339. <dl>
  340. <dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
  341. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true#write-byte:A-" title="class or interface in java.io">write</a></code>&nbsp;in class&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a></code></dd>
  342. <dt><span class="paramLabel">Parameters:</span></dt>
  343. <dd><code>b</code> - The array of bytes to be written.</dd>
  344. <dt><span class="throwsLabel">Throws:</span></dt>
  345. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an error occurs.</dd>
  346. </dl>
  347. </li>
  348. </ul>
  349. <a name="write-byte:A-int-int-">
  350. <!-- -->
  351. </a>
  352. <ul class="blockList">
  353. <li class="blockList">
  354. <h4>write</h4>
  355. <pre>public&nbsp;void&nbsp;write(byte[]&nbsp;b,
  356. int&nbsp;off,
  357. int&nbsp;len)
  358. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  359. <div class="block">Writes <code>len</code> bytes from the specified byte array starting at
  360. offset <code>off</code> to this output stream.</div>
  361. <dl>
  362. <dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
  363. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true#write-byte:A-int-int-" title="class or interface in java.io">write</a></code>&nbsp;in class&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a></code></dd>
  364. <dt><span class="paramLabel">Parameters:</span></dt>
  365. <dd><code>b</code> - The byte array from which the data will be written.</dd>
  366. <dd><code>off</code> - The start offset in the byte array.</dd>
  367. <dd><code>len</code> - The number of bytes to write.</dd>
  368. <dt><span class="throwsLabel">Throws:</span></dt>
  369. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an error occurs.</dd>
  370. </dl>
  371. </li>
  372. </ul>
  373. <a name="flush--">
  374. <!-- -->
  375. </a>
  376. <ul class="blockList">
  377. <li class="blockList">
  378. <h4>flush</h4>
  379. <pre>public&nbsp;void&nbsp;flush()
  380. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  381. <div class="block">Flushes this output stream and forces any buffered output bytes to be
  382. written out.</div>
  383. <dl>
  384. <dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
  385. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Flushable.html?is-external=true#flush--" title="class or interface in java.io">flush</a></code>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Flushable.html?is-external=true" title="class or interface in java.io">Flushable</a></code></dd>
  386. <dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
  387. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true#flush--" title="class or interface in java.io">flush</a></code>&nbsp;in class&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a></code></dd>
  388. <dt><span class="throwsLabel">Throws:</span></dt>
  389. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an error occurs.</dd>
  390. </dl>
  391. </li>
  392. </ul>
  393. <a name="close--">
  394. <!-- -->
  395. </a>
  396. <ul class="blockList">
  397. <li class="blockList">
  398. <h4>close</h4>
  399. <pre>public&nbsp;void&nbsp;close()
  400. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  401. <div class="block">Closes this output stream and releases any system resources associated
  402. with this stream.</div>
  403. <dl>
  404. <dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
  405. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Closeable.html?is-external=true#close--" title="class or interface in java.io">close</a></code>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a></code></dd>
  406. <dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
  407. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/AutoCloseable.html?is-external=true#close--" title="class or interface in java.lang">close</a></code>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a></code></dd>
  408. <dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
  409. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true#close--" title="class or interface in java.io">close</a></code>&nbsp;in class&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a></code></dd>
  410. <dt><span class="throwsLabel">Throws:</span></dt>
  411. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an error occurs.</dd>
  412. </dl>
  413. </li>
  414. </ul>
  415. <a name="getThreshold--">
  416. <!-- -->
  417. </a>
  418. <ul class="blockList">
  419. <li class="blockList">
  420. <h4>getThreshold</h4>
  421. <pre>public&nbsp;int&nbsp;getThreshold()</pre>
  422. <div class="block">Returns the threshold, in bytes, at which an event will be triggered.</div>
  423. <dl>
  424. <dt><span class="returnLabel">Returns:</span></dt>
  425. <dd>The threshold point, in bytes.</dd>
  426. </dl>
  427. </li>
  428. </ul>
  429. <a name="getByteCount--">
  430. <!-- -->
  431. </a>
  432. <ul class="blockList">
  433. <li class="blockList">
  434. <h4>getByteCount</h4>
  435. <pre>public&nbsp;long&nbsp;getByteCount()</pre>
  436. <div class="block">Returns the number of bytes that have been written to this output stream.</div>
  437. <dl>
  438. <dt><span class="returnLabel">Returns:</span></dt>
  439. <dd>The number of bytes written.</dd>
  440. </dl>
  441. </li>
  442. </ul>
  443. <a name="isThresholdExceeded--">
  444. <!-- -->
  445. </a>
  446. <ul class="blockList">
  447. <li class="blockList">
  448. <h4>isThresholdExceeded</h4>
  449. <pre>public&nbsp;boolean&nbsp;isThresholdExceeded()</pre>
  450. <div class="block">Determines whether or not the configured threshold has been exceeded for
  451. this output stream.</div>
  452. <dl>
  453. <dt><span class="returnLabel">Returns:</span></dt>
  454. <dd><code>true</code> if the threshold has been reached;
  455. <code>false</code> otherwise.</dd>
  456. </dl>
  457. </li>
  458. </ul>
  459. <a name="checkThreshold-int-">
  460. <!-- -->
  461. </a>
  462. <ul class="blockList">
  463. <li class="blockList">
  464. <h4>checkThreshold</h4>
  465. <pre>protected&nbsp;void&nbsp;checkThreshold(int&nbsp;count)
  466. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  467. <div class="block">Checks to see if writing the specified number of bytes would cause the
  468. configured threshold to be exceeded. If so, triggers an event to allow
  469. a concrete implementation to take action on this.</div>
  470. <dl>
  471. <dt><span class="paramLabel">Parameters:</span></dt>
  472. <dd><code>count</code> - The number of bytes about to be written to the underlying
  473. output stream.</dd>
  474. <dt><span class="throwsLabel">Throws:</span></dt>
  475. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an error occurs.</dd>
  476. </dl>
  477. </li>
  478. </ul>
  479. <a name="resetByteCount--">
  480. <!-- -->
  481. </a>
  482. <ul class="blockList">
  483. <li class="blockList">
  484. <h4>resetByteCount</h4>
  485. <pre>protected&nbsp;void&nbsp;resetByteCount()</pre>
  486. <div class="block">Resets the byteCount to zero. You can call this from
  487. <a href="../../../../../org/apache/commons/io/output/ThresholdingOutputStream.html#thresholdReached--"><code>thresholdReached()</code></a> if you want the event to be triggered again.</div>
  488. </li>
  489. </ul>
  490. <a name="setByteCount-long-">
  491. <!-- -->
  492. </a>
  493. <ul class="blockList">
  494. <li class="blockList">
  495. <h4>setByteCount</h4>
  496. <pre>protected&nbsp;void&nbsp;setByteCount(long&nbsp;count)</pre>
  497. <div class="block">Sets the byteCount to count. Useful for re-opening an output stream
  498. that has previously been written to.</div>
  499. <dl>
  500. <dt><span class="paramLabel">Parameters:</span></dt>
  501. <dd><code>count</code> - The number of bytes that have already been written to the
  502. output stream</dd>
  503. <dt><span class="simpleTagLabel">Since:</span></dt>
  504. <dd>2.5</dd>
  505. </dl>
  506. </li>
  507. </ul>
  508. <a name="getStream--">
  509. <!-- -->
  510. </a>
  511. <ul class="blockList">
  512. <li class="blockList">
  513. <h4>getStream</h4>
  514. <pre>protected abstract&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a>&nbsp;getStream()
  515. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  516. <div class="block">Returns the underlying output stream, to which the corresponding
  517. <code>OutputStream</code> methods in this class will ultimately delegate.</div>
  518. <dl>
  519. <dt><span class="returnLabel">Returns:</span></dt>
  520. <dd>The underlying output stream.</dd>
  521. <dt><span class="throwsLabel">Throws:</span></dt>
  522. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an error occurs.</dd>
  523. </dl>
  524. </li>
  525. </ul>
  526. <a name="thresholdReached--">
  527. <!-- -->
  528. </a>
  529. <ul class="blockListLast">
  530. <li class="blockList">
  531. <h4>thresholdReached</h4>
  532. <pre>protected abstract&nbsp;void&nbsp;thresholdReached()
  533. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  534. <div class="block">Indicates that the configured threshold has been reached, and that a
  535. subclass should take whatever action necessary on this event. This may
  536. include changing the underlying output stream.</div>
  537. <dl>
  538. <dt><span class="throwsLabel">Throws:</span></dt>
  539. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an error occurs.</dd>
  540. </dl>
  541. </li>
  542. </ul>
  543. </li>
  544. </ul>
  545. </li>
  546. </ul>
  547. </div>
  548. </div>
  549. <!-- ========= END OF CLASS DATA ========= -->
  550. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  551. <div class="bottomNav"><a name="navbar.bottom">
  552. <!-- -->
  553. </a>
  554. <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
  555. <a name="navbar.bottom.firstrow">
  556. <!-- -->
  557. </a>
  558. <ul class="navList" title="Navigation">
  559. <li><a href="../../../../../overview-summary.html">Overview</a></li>
  560. <li><a href="package-summary.html">Package</a></li>
  561. <li class="navBarCell1Rev">Class</li>
  562. <li><a href="class-use/ThresholdingOutputStream.html">Use</a></li>
  563. <li><a href="package-tree.html">Tree</a></li>
  564. <li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
  565. <li><a href="../../../../../index-all.html">Index</a></li>
  566. <li><a href="../../../../../help-doc.html">Help</a></li>
  567. </ul>
  568. </div>
  569. <div class="subNav">
  570. <ul class="navList">
  571. <li><a href="../../../../../org/apache/commons/io/output/TeeOutputStream.html" title="class in org.apache.commons.io.output"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  572. <li><a href="../../../../../org/apache/commons/io/output/WriterOutputStream.html" title="class in org.apache.commons.io.output"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  573. </ul>
  574. <ul class="navList">
  575. <li><a href="../../../../../index.html?org/apache/commons/io/output/ThresholdingOutputStream.html" target="_top">Frames</a></li>
  576. <li><a href="ThresholdingOutputStream.html" target="_top">No&nbsp;Frames</a></li>
  577. </ul>
  578. <ul class="navList" id="allclasses_navbar_bottom">
  579. <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
  580. </ul>
  581. <div>
  582. <script type="text/javascript"><!--
  583. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  584. if(window==top) {
  585. allClassesLink.style.display = "block";
  586. }
  587. else {
  588. allClassesLink.style.display = "none";
  589. }
  590. //-->
  591. </script>
  592. </div>
  593. <div>
  594. <ul class="subNavList">
  595. <li>Summary:&nbsp;</li>
  596. <li>Nested&nbsp;|&nbsp;</li>
  597. <li>Field&nbsp;|&nbsp;</li>
  598. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  599. <li><a href="#method.summary">Method</a></li>
  600. </ul>
  601. <ul class="subNavList">
  602. <li>Detail:&nbsp;</li>
  603. <li>Field&nbsp;|&nbsp;</li>
  604. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  605. <li><a href="#method.detail">Method</a></li>
  606. </ul>
  607. </div>
  608. <a name="skip.navbar.bottom">
  609. <!-- -->
  610. </a></div>
  611. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  612. <p class="legalCopy"><small>Copyright &#169; 2002&#x2013;2017 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
  613. </body>
  614. </html>