📄 multipartstream.html
字号:
<A NAME="getHeaderEncoding()"><!-- --></A><H3>getHeaderEncoding</H3><PRE>public java.lang.String <B>getHeaderEncoding</B>()</PRE><DL><DD>Retrieves the character encoding used when reading the headers of an individual part. When not specified, or <code>null</code>, the platform default encoding is used.<P><DD><DL><DT><B>Returns:</B><DD>The encoding used to read part headers.</DL></DD></DL><HR><A NAME="setHeaderEncoding(java.lang.String)"><!-- --></A><H3>setHeaderEncoding</H3><PRE>public void <B>setHeaderEncoding</B>(java.lang.String encoding)</PRE><DL><DD>Specifies the character encoding to be used when reading the headers of individual parts. When not specified, or <code>null</code>, the platform default encoding is used.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>encoding</CODE> - The encoding used to read part headers.</DL></DD></DL><HR><A NAME="readByte()"><!-- --></A><H3>readByte</H3><PRE>public byte <B>readByte</B>() throws java.io.IOException</PRE><DL><DD>Reads a byte from the <code>buffer</code>, and refills it as necessary.<P><DD><DL><DT><B>Returns:</B><DD>The next byte from the input stream.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if there is no more data available.</DL></DD></DL><HR><A NAME="readBoundary()"><!-- --></A><H3>readBoundary</H3><PRE>public boolean <B>readBoundary</B>() throws <A HREF="../../../../org/apache/commons/fileupload/MultipartStream.MalformedStreamException.html" title="class in org.apache.commons.fileupload">MultipartStream.MalformedStreamException</A></PRE><DL><DD>Skips a <code>boundary</code> token, and checks whether more <code>encapsulations</code> are contained in the stream.<P><DD><DL><DT><B>Returns:</B><DD><code>true</code> if there are more encapsulations in this stream; <code>false</code> otherwise.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.MalformedStreamException.html" title="class in org.apache.commons.fileupload">MultipartStream.MalformedStreamException</A></CODE> - if the stream ends unexpecetedly or fails to follow required syntax.</DL></DD></DL><HR><A NAME="setBoundary(byte[])"><!-- --></A><H3>setBoundary</H3><PRE>public void <B>setBoundary</B>(byte[] boundary) throws <A HREF="../../../../org/apache/commons/fileupload/MultipartStream.IllegalBoundaryException.html" title="class in org.apache.commons.fileupload">MultipartStream.IllegalBoundaryException</A></PRE><DL><DD><p>Changes the boundary token used for partitioning the stream. <p>This method allows single pass processing of nested multipart streams. <p>The boundary token of the nested stream is <code>required</code> to be of the same length as the boundary token in parent stream. <p>Restoring the parent stream boundary token after processing of a nested stream is left to the application.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>boundary</CODE> - The boundary to be used for parsing of the nested stream.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.IllegalBoundaryException.html" title="class in org.apache.commons.fileupload">MultipartStream.IllegalBoundaryException</A></CODE> - if the <code>boundary</code> has a different length than the one being currently parsed.</DL></DD></DL><HR><A NAME="readHeaders()"><!-- --></A><H3>readHeaders</H3><PRE>public java.lang.String <B>readHeaders</B>() throws <A HREF="../../../../org/apache/commons/fileupload/MultipartStream.MalformedStreamException.html" title="class in org.apache.commons.fileupload">MultipartStream.MalformedStreamException</A></PRE><DL><DD><p>Reads the <code>header-part</code> of the current <code>encapsulation</code>. <p>Headers are returned verbatim to the input stream, including the trailing <code>CRLF</code> marker. Parsing is left to the application. <p><strong>TODO</strong> allow limiting maximum header size to protect against abuse.<P><DD><DL><DT><B>Returns:</B><DD>The <code>header-part</code> of the current encapsulation.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.MalformedStreamException.html" title="class in org.apache.commons.fileupload">MultipartStream.MalformedStreamException</A></CODE> - if the stream ends unexpecetedly.</DL></DD></DL><HR><A NAME="readBodyData(java.io.OutputStream)"><!-- --></A><H3>readBodyData</H3><PRE>public int <B>readBodyData</B>(java.io.OutputStream output) throws <A HREF="../../../../org/apache/commons/fileupload/MultipartStream.MalformedStreamException.html" title="class in org.apache.commons.fileupload">MultipartStream.MalformedStreamException</A>, java.io.IOException</PRE><DL><DD><p>Reads <code>body-data</code> from the current <code>encapsulation</code> and writes its contents into the output <code>Stream</code>. <p>Arbitrary large amounts of data can be processed by this method using a constant size buffer. (see <A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#MultipartStream(java.io.InputStream, byte[], int)"><CODE>constructor</CODE></A>).<P><DD><DL><DT><B>Parameters:</B><DD><CODE>output</CODE> - The <code>Stream</code> to write data into.<DT><B>Returns:</B><DD>the amount of data written.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.MalformedStreamException.html" title="class in org.apache.commons.fileupload">MultipartStream.MalformedStreamException</A></CODE> - if the stream ends unexpectedly.<DD><CODE>java.io.IOException</CODE> - if an i/o error occurs.</DL></DD></DL><HR><A NAME="discardBodyData()"><!-- --></A><H3>discardBodyData</H3><PRE>public int <B>discardBodyData</B>() throws <A HREF="../../../../org/apache/commons/fileupload/MultipartStream.MalformedStreamException.html" title="class in org.apache.commons.fileupload">MultipartStream.MalformedStreamException</A>, java.io.IOException</PRE><DL><DD><p> Reads <code>body-data</code> from the current <code>encapsulation</code> and discards it. <p>Use this method to skip encapsulations you don't need or don't understand.<P><DD><DL><DT><B>Returns:</B><DD>The amount of data discarded.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.MalformedStreamException.html" title="class in org.apache.commons.fileupload">MultipartStream.MalformedStreamException</A></CODE> - if the stream ends unexpectedly.<DD><CODE>java.io.IOException</CODE> - if an i/o error occurs.</DL></DD></DL><HR><A NAME="skipPreamble()"><!-- --></A><H3>skipPreamble</H3><PRE>public boolean <B>skipPreamble</B>() throws java.io.IOException</PRE><DL><DD>Finds the beginning of the first <code>encapsulation</code>.<P><DD><DL><DT><B>Returns:</B><DD><code>true</code> if an <code>encapsulation</code> was found in the stream.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an i/o error occurs.</DL></DD></DL><HR><A NAME="arrayequals(byte[], byte[], int)"><!-- --></A><H3>arrayequals</H3><PRE>public static boolean <B>arrayequals</B>(byte[] a, byte[] b, int count)</PRE><DL><DD>Compares <code>count</code> first bytes in the arrays <code>a</code> and <code>b</code>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>a</CODE> - The first array to compare.<DD><CODE>b</CODE> - The second array to compare.<DD><CODE>count</CODE> - How many bytes should be compared.<DT><B>Returns:</B><DD><code>true</code> if <code>count</code> first bytes in arrays <code>a</code> and <code>b</code> are equal.</DL></DD></DL><HR><A NAME="findByte(byte, int)"><!-- --></A><H3>findByte</H3><PRE>protected int <B>findByte</B>(byte value, int pos)</PRE><DL><DD>Searches for a byte of specified value in the <code>buffer</code>, starting at the specified <code>position</code>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>value</CODE> - The value to find.<DD><CODE>pos</CODE> - The starting position for searching.<DT><B>Returns:</B><DD>The position of byte found, counting from beginning of the <code>buffer</code>, or <code>-1</code> if not found.</DL></DD></DL><HR><A NAME="findSeparator()"><!-- --></A><H3>findSeparator</H3><PRE>protected int <B>findSeparator</B>()</PRE><DL><DD>Searches for the <code>boundary</code> in the <code>buffer</code> region delimited by <code>head</code> and <code>tail</code>.<P><DD><DL><DT><B>Returns:</B><DD>The position of the boundary found, counting from the beginning of the <code>buffer</code>, or <code>-1</code> if not found.</DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public java.lang.String <B>toString</B>()</PRE><DL><DD>Returns a string representation of this object.<P><DD><DL><DT><B>Returns:</B><DD>The string representation of this object.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/MultipartStream.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../org/apache/commons/fileupload/FileUploadBase.html" title="class in org.apache.commons.fileupload"><B>PREV CLASS</B></A> <A HREF="../../../../org/apache/commons/fileupload/ParameterParser.html" title="class in org.apache.commons.fileupload"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="MultipartStream.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR>Copyright © 2002-2006 The Apache Software Foundation. All Rights Reserved.</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -