📄 limitinputstream.html
字号:
<DL><DD>Creates a new instance of LimitInputStream<P><DT><B>Parameters:</B><DD><CODE>in</CODE> - the stream which will be limited.<DD><CODE>limit</CODE> - the number of bytes which can be read from the stream.</DL><HR><A NAME="LimitInputStream(java.io.InputStream, long, boolean)"><!-- --></A><H3>LimitInputStream</H3><PRE>public <B>LimitInputStream</B>(java.io.InputStream in, long limit, boolean underflowThrows)</PRE><DL><DD>Creates a new instance of LimitInputStream<P><DT><B>Parameters:</B><DD><CODE>in</CODE> - the stream which will be limited.<DD><CODE>limit</CODE> - the number of bytes which can be read from the stream.<DD><CODE>underflowThrows</CODE> - if the underlying stream EOFs before limit then an IOException will be thrown.</DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public java.lang.String <B>toString</B>()</PRE><DL><DD> <p/>Debugging toString.<P><DD><DL></DL></DD></DL><HR><A NAME="close()"><!-- --></A><H3>close</H3><PRE>public void <B>close</B>() throws java.io.IOException</PRE><DL><DD>Closes this input stream and releases any system resources associated with the stream. <p/> This method simply forgets the underlying stream.<P><DD><DL><DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an I/O error occurs.<DT><B>See Also:</B><DD><CODE>FilterInputStream.in</CODE></DL></DD></DL><HR><A NAME="available()"><!-- --></A><H3>available</H3><PRE>public int <B>available</B>() throws java.io.IOException</PRE><DL><DD>Returns the number of bytes that can be read from this input stream without blocking. <p> This method simply performs <code>in.available(n)</code> and returns the result.<P><DD><DL><DT><B>Returns:</B><DD>the number of bytes that can be read from the input stream without blocking.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an I/O error occurs.<DT><B>See Also:</B><DD><CODE>FilterInputStream.in</CODE></DL></DD></DL><HR><A NAME="mark(int)"><!-- --></A><H3>mark</H3><PRE>public void <B>mark</B>(int readlimit)</PRE><DL><DD>Marks the current position in this input stream. A subsequent call to the <code>reset</code> method repositions this stream at the last marked position so that subsequent reads re-read the same bytes. <p> The <code>readlimit</code> argument tells this input stream to allow that many bytes to be read before the mark position gets invalidated. <p> This method simply performs <code>in.mark(readlimit)</code>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>readlimit</CODE> - the maximum limit of bytes that can be read before the mark position becomes invalid.<DT><B>See Also:</B><DD><CODE>FilterInputStream.in</CODE>, <CODE>FilterInputStream.reset()</CODE></DL></DD></DL><HR><A NAME="reset()"><!-- --></A><H3>reset</H3><PRE>public void <B>reset</B>() throws java.io.IOException</PRE><DL><DD>Repositions this stream to the position at the time the <code>mark</code> method was last called on this input stream. <p> This method simply performs <code>in.reset()</code>. <p> Stream marks are intended to be used in situations where you need to read ahead a little to see what's in the stream. Often this is most easily done by invoking some general parser. If the stream is of the type handled by the parse, it just chugs along happily. If the stream is not of that type, the parser should toss an exception when it fails. If this happens within readlimit bytes, it allows the outer code to reset the stream and try another parser.<P><DD><DL><DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if the stream has not been marked or if the mark has been invalidated.<DT><B>See Also:</B><DD><CODE>FilterInputStream.in</CODE>, <CODE>FilterInputStream.mark(int)</CODE></DL></DD></DL><HR><A NAME="skip(long)"><!-- --></A><H3>skip</H3><PRE>public long <B>skip</B>(long n) throws java.io.IOException</PRE><DL><DD>Skips over and discards <code>n</code> bytes of data from the input stream. The <code>skip</code> method may, for a variety of reasons, end up skipping over some smaller number of bytes, possibly <code>0</code>. The actual number of bytes skipped is returned. <p> This method simply performs <code>in.skip(n)</code>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>n</CODE> - the number of bytes to be skipped.<DT><B>Returns:</B><DD>the actual number of bytes skipped.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an I/O error occurs.</DL></DD></DL><HR><A NAME="read()"><!-- --></A><H3>read</H3><PRE>public int <B>read</B>() throws java.io.IOException</PRE><DL><DD>Reads the next byte of data from this input stream. The value byte is returned as an <code>int</code> in the range <code>0</code> to <code>255</code>. If no byte is available because the end of the stream has been reached, the value <code>-1</code> is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown. <p> This method simply performs <code>in.read()</code> and returns the result.<P><DD><DL><DT><B>Returns:</B><DD>the next byte of data, or <code>-1</code> if the end of the stream is reached.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an I/O error occurs.<DT><B>See Also:</B><DD><CODE>FilterInputStream.in</CODE></DL></DD></DL><HR><A NAME="read(byte[], int, int)"><!-- --></A><H3>read</H3><PRE>public int <B>read</B>(byte[] b, int off, int len) throws java.io.IOException</PRE><DL><DD>Reads up to <code>len</code> bytes of data from this input stream into an array of bytes. This method blocks until some input is available. <p> This method simply performs <code>in.read(b, off, len)</code> and returns the result.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>b</CODE> - the buffer into which the data is read.<DD><CODE>off</CODE> - the start offset of the data.<DD><CODE>len</CODE> - the maximum number of bytes read.<DT><B>Returns:</B><DD>the total number of bytes read into the buffer, or <code>-1</code> if there is no more data because the end of the stream has been reached.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an I/O error occurs.<DT><B>See Also:</B><DD><CODE>FilterInputStream.in</CODE></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/LimitInputStream.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>JXTA J2SE</EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../net/jxta/util/JxtaUtilities.html" title="class in net.jxta.util"><B>PREV CLASS</B></A> <A HREF="../../../net/jxta/util/MarkProhibitedFilterStream.html" title="class in net.jxta.util"><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="LimitInputStream.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: NESTED | <A HREF="#fields_inherited_from_class_java.io.FilterInputStream">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: FIELD | <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></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -