⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 multipartstream.html

📁 ava 项目中
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<a name="159" href="#159">159</a> <a name="160" href="#160">160</a> <a name="161" href="#161">161</a>     <em>/**</em><a name="162" href="#162">162</a> <em>     * The maximum length of &lt;code>header-part&lt;/code> that will be</em><a name="163" href="#163">163</a> <em>     * processed (10 kilobytes = 10240 bytes.).</em><a name="164" href="#164">164</a> <em>     */</em><a name="165" href="#165">165</a>     <strong>public</strong> <strong>static</strong> <strong>final</strong> <strong>int</strong> HEADER_PART_SIZE_MAX = 10240;<a name="166" href="#166">166</a> <a name="167" href="#167">167</a> <a name="168" href="#168">168</a>     <em>/**</em><a name="169" href="#169">169</a> <em>     * The default length of the buffer used for processing a request.</em><a name="170" href="#170">170</a> <em>     */</em><a name="171" href="#171">171</a>     <strong>protected</strong> <strong>static</strong> <strong>final</strong> <strong>int</strong> DEFAULT_BUFSIZE = 4096;<a name="172" href="#172">172</a> <a name="173" href="#173">173</a> <a name="174" href="#174">174</a>     <em>/**</em><a name="175" href="#175">175</a> <em>     * A byte sequence that marks the end of &lt;code>header-part&lt;/code></em><a name="176" href="#176">176</a> <em>     * (&lt;code>CRLFCRLF&lt;/code>).</em><a name="177" href="#177">177</a> <em>     */</em><a name="178" href="#178">178</a>     <strong>protected</strong> <strong>static</strong> <strong>final</strong> byte[] HEADER_SEPARATOR = {<a name="179" href="#179">179</a>         CR, LF, CR, LF };<a name="180" href="#180">180</a> <a name="181" href="#181">181</a> <a name="182" href="#182">182</a>     <em>/**</em><a name="183" href="#183">183</a> <em>     * A byte sequence that that follows a delimiter that will be</em><a name="184" href="#184">184</a> <em>     * followed by an encapsulation (&lt;code>CRLF&lt;/code>).</em><a name="185" href="#185">185</a> <em>     */</em><a name="186" href="#186">186</a>     <strong>protected</strong> <strong>static</strong> <strong>final</strong> byte[] FIELD_SEPARATOR = {<a name="187" href="#187">187</a>         CR, LF};<a name="188" href="#188">188</a> <a name="189" href="#189">189</a> <a name="190" href="#190">190</a>     <em>/**</em><a name="191" href="#191">191</a> <em>     * A byte sequence that that follows a delimiter of the last</em><a name="192" href="#192">192</a> <em>     * encapsulation in the stream (&lt;code>--&lt;/code>).</em><a name="193" href="#193">193</a> <em>     */</em><a name="194" href="#194">194</a>     <strong>protected</strong> <strong>static</strong> <strong>final</strong> byte[] STREAM_TERMINATOR = {<a name="195" href="#195">195</a>         DASH, DASH};<a name="196" href="#196">196</a> <a name="197" href="#197">197</a> <a name="198" href="#198">198</a>     <em>/**</em><a name="199" href="#199">199</a> <em>     * A byte sequence that precedes a boundary (&lt;code>CRLF--&lt;/code>).</em><a name="200" href="#200">200</a> <em>     */</em><a name="201" href="#201">201</a>     <strong>protected</strong> <strong>static</strong> <strong>final</strong> byte[] BOUNDARY_PREFIX = {<a name="202" href="#202">202</a>         CR, LF, DASH, DASH};<a name="203" href="#203">203</a> <a name="204" href="#204">204</a> <a name="205" href="#205">205</a>     <em>/**</em><a name="206" href="#206">206</a> <em>     * The number of bytes, over and above the boundary size, to use for the</em><a name="207" href="#207">207</a> <em>     * keep region.</em><a name="208" href="#208">208</a> <em>     */</em><a name="209" href="#209">209</a>     <strong>private</strong> <strong>static</strong> <strong>final</strong> <strong>int</strong> KEEP_REGION_PAD = 3;<a name="210" href="#210">210</a> <a name="211" href="#211">211</a> <a name="212" href="#212">212</a>     <em class="comment">// ----------------------------------------------------------- Data members</em><a name="213" href="#213">213</a> <a name="214" href="#214">214</a> <a name="215" href="#215">215</a>     <em>/**</em><a name="216" href="#216">216</a> <em>     * The input stream from which data is read.</em><a name="217" href="#217">217</a> <em>     */</em><a name="218" href="#218">218</a>     <strong>private</strong> <strong>final</strong> InputStream input;<a name="219" href="#219">219</a> <a name="220" href="#220">220</a> <a name="221" href="#221">221</a>     <em>/**</em><a name="222" href="#222">222</a> <em>     * The length of the boundary token plus the leading &lt;code>CRLF--&lt;/code>.</em><a name="223" href="#223">223</a> <em>     */</em><a name="224" href="#224">224</a>     <strong>private</strong> <strong>int</strong> boundaryLength;<a name="225" href="#225">225</a> <a name="226" href="#226">226</a> <a name="227" href="#227">227</a>     <em>/**</em><a name="228" href="#228">228</a> <em>     * The amount of data, in bytes, that must be kept in the buffer in order</em><a name="229" href="#229">229</a> <em>     * to detect delimiters reliably.</em><a name="230" href="#230">230</a> <em>     */</em><a name="231" href="#231">231</a>     <strong>private</strong> <strong>int</strong> keepRegion;<a name="232" href="#232">232</a> <a name="233" href="#233">233</a> <a name="234" href="#234">234</a>     <em>/**</em><a name="235" href="#235">235</a> <em>     * The byte sequence that partitions the stream.</em><a name="236" href="#236">236</a> <em>     */</em><a name="237" href="#237">237</a>     <strong>private</strong> byte[] boundary;<a name="238" href="#238">238</a> <a name="239" href="#239">239</a> <a name="240" href="#240">240</a>     <em>/**</em><a name="241" href="#241">241</a> <em>     * The length of the buffer used for processing the request.</em><a name="242" href="#242">242</a> <em>     */</em><a name="243" href="#243">243</a>     <strong>private</strong> <strong>final</strong> <strong>int</strong> bufSize;<a name="244" href="#244">244</a> <a name="245" href="#245">245</a> <a name="246" href="#246">246</a>     <em>/**</em><a name="247" href="#247">247</a> <em>     * The buffer used for processing the request.</em><a name="248" href="#248">248</a> <em>     */</em><a name="249" href="#249">249</a>     <strong>private</strong> <strong>final</strong> byte[] buffer;<a name="250" href="#250">250</a> <a name="251" href="#251">251</a> <a name="252" href="#252">252</a>     <em>/**</em><a name="253" href="#253">253</a> <em>     * The index of first valid character in the buffer.</em><a name="254" href="#254">254</a> <em>     * &lt;br></em><a name="255" href="#255">255</a> <em>     * 0 &lt;= head &lt; bufSize</em><a name="256" href="#256">256</a> <em>     */</em><a name="257" href="#257">257</a>     <strong>private</strong> <strong>int</strong> head;<a name="258" href="#258">258</a> <a name="259" href="#259">259</a> <a name="260" href="#260">260</a>     <em>/**</em><a name="261" href="#261">261</a> <em>     * The index of last valid characer in the buffer + 1.</em><a name="262" href="#262">262</a> <em>     * &lt;br></em><a name="263" href="#263">263</a> <em>     * 0 &lt;= tail &lt;= bufSize</em><a name="264" href="#264">264</a> <em>     */</em><a name="265" href="#265">265</a>     <strong>private</strong> <strong>int</strong> tail;<a name="266" href="#266">266</a> <a name="267" href="#267">267</a> <a name="268" href="#268">268</a>     <em>/**</em><a name="269" href="#269">269</a> <em>     * The content encoding to use when reading headers.</em><a name="270" href="#270">270</a> <em>     */</em><a name="271" href="#271">271</a>     <strong>private</strong> String headerEncoding;<a name="272" href="#272">272</a> <a name="273" href="#273">273</a> <a name="274" href="#274">274</a>     <em>/**</em><a name="275" href="#275">275</a> <em>     * The progress notifier, if any, or null.</em><a name="276" href="#276">276</a> <em>     */</em><a name="277" href="#277">277</a>     <strong>private</strong> <strong>final</strong> ProgressNotifier notifier;<a name="278" href="#278">278</a> <a name="279" href="#279">279</a>     <em class="comment">// ----------------------------------------------------------- Constructors</em><a name="280" href="#280">280</a> <a name="281" href="#281">281</a>     <em>/**</em><a name="282" href="#282">282</a> <em>     * Creates a new instance.</em><a name="283" href="#283">283</a> <em>     * @deprecated Use {@link #MultipartStream(InputStream, byte[],</em><a name="284" href="#284">284</a> <em>     * org.apache.commons.fileupload.MultipartStream.ProgressNotifier)},</em><a name="285" href="#285">285</a> <em>     * or {@link #MultipartStream(InputStream, byte[], int,</em><a name="286" href="#286">286</a> <em>     * org.apache.commons.fileupload.MultipartStream.ProgressNotifier)}</em><a name="287" href="#287">287</a> <em>     */</em><a name="288" href="#288">288</a>     <strong>public</strong> <a href="../../../../org/apache/commons/fileupload/MultipartStream.html">MultipartStream</a>() {<a name="289" href="#289">289</a>         <strong>this</strong>(<strong>null</strong>, <strong>null</strong>, <strong>null</strong>);<a name="290" href="#290">290</a>     }<a name="291" href="#291">291</a> <a name="292" href="#292">292</a>     <em>/**</em><a name="293" href="#293">293</a> <em>     * &lt;p> Constructs a &lt;code>MultipartStream&lt;/code> with a custom size buffer</em><a name="294" href="#294">294</a> <em>     * and no progress notifier.</em><a name="295" href="#295">295</a> <em>     *</em><a name="296" href="#296">296</a> <em>     * &lt;p> Note that the buffer must be at least big enough to contain the</em><a name="297" href="#297">297</a> <em>     * boundary string, plus 4 characters for CR/LF and double dash, plus at</em><a name="298" href="#298">298</a> <em>     * least one byte of data.  Too small a buffer size setting will degrade</em><a name="299" href="#299">299</a> <em>     * performance.</em><a name="300" href="#300">300</a> <em>     *</em><a name="301" href="#301">301</a> <em>     * @param input    The &lt;code>InputStream&lt;/code> to serve as a data source.</em><a name="302" href="#302">302</a> <em>     * @param boundary The token used for dividing the stream into</em><a name="303" href="#303">303</a> <em>     *                 &lt;code>encapsulations&lt;/code>.</em><a name="304" href="#304">304</a> <em>     * @param bufSize  The size of the buffer to be used, in bytes.</em><a name="305" href="#305">305</a> <em>     *</em><a name="306" href="#306">306</a> <em>     * @see #MultipartStream(InputStream, byte[], ProgressNotifier)</em><a name="307" href="#307">307</a> <em>     * @deprecated Use {@link #MultipartStream(InputStream, byte[], int,</em><a name="308" href="#308">308</a> <em>     *  org.apache.commons.fileupload.MultipartStream.ProgressNotifier)}.</em><a name="309" href="#309">309</a> <em>     */</em><a name="310" href="#310">310</a>     <strong>public</strong> <a href="../../../../org/apache/commons/fileupload/MultipartStream.html">MultipartStream</a>(InputStream input, byte[] boundary, <strong>int</strong> bufSize) {<a name="311" href="#311">311</a>         <strong>this</strong>(input, boundary, bufSize, <strong>null</strong>);<a name="312" href="#312">312</a>     }<a name="313" href="#313">313</a> <a name="314" href="#314">314</a>     <em>/**</em><a name="315" href="#315">315</a> <em>     * &lt;p> Constructs a &lt;code>MultipartStream&lt;/code> with a custom size buffer.</em><a name="316" href="#316">316</a> <em>     *</em><a name="317" href="#317">317</a> <em>     * &lt;p> Note that the buffer must be at least big enough to contain the</em><a name="318" href="#318">318</a> <em>     * boundary string, plus 4 characters for CR/LF and double dash, plus at</em><a name="319" href="#319">319</a> <em>     * least one byte of data.  Too small a buffer size setting will degrade</em><a name="320" href="#320">320</a> <em>     * performance.</em><a name="321" href="#321">321</a> <em>     *</em><a name="322" href="#322">322</a> <em>     * @param input    The &lt;code>InputStream&lt;/code> to serve as a data source.</em><a name="323" href="#323">323</a> <em>     * @param boundary The token used for dividing the stream into</em><a name="324" href="#324">324</a> <em>     *                 &lt;code>encapsulations&lt;/code>.</em><a name="325" href="#325">325</a> <em>     * @param bufSize  The size of the buffer to be used, in bytes.</em>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -