sharedfileinputstream.html
来自「j2ee帮助文档软件设计/软件工程 文件格式」· HTML 代码 · 共 826 行 · 第 1/3 页
HTML
826 行
throws <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Reads bytes from this stream into the specified byte array, starting at the given offset. <p> This method implements the general contract of the corresponding <code><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/InputStream.html#read(byte[], int, int)" title="class or interface in java.io"><CODE>read</CODE></A></code> method of the <code><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/InputStream.html" title="class or interface in java.io"><CODE>InputStream</CODE></A></code> class.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/BufferedInputStream.html#read(byte[], int, int)" title="class or interface in java.io">read</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/BufferedInputStream.html" title="class or interface in java.io">BufferedInputStream</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>b</CODE> - destination buffer.<DD><CODE>off</CODE> - offset at which to start storing bytes.<DD><CODE>len</CODE> - maximum number of bytes to read.<DT><B>Returns:</B><DD>the number of bytes read, or <code>-1</code> if the end of the stream has been reached.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if an I/O error occurs.</DL></DD></DL><HR><A NAME="skip(long)"><!-- --></A><H3>skip</H3><PRE>public long <B>skip</B>(long n) throws <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>See the general contract of the <code>skip</code> method of <code>InputStream</code>.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/BufferedInputStream.html#skip(long)" title="class or interface in java.io">skip</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/BufferedInputStream.html" title="class or interface in java.io">BufferedInputStream</A></CODE></DL></DD><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><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if an I/O error occurs.</DL></DD></DL><HR><A NAME="available()"><!-- --></A><H3>available</H3><PRE>public int <B>available</B>() throws <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Returns the number of bytes that can be read from this input stream without blocking.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/BufferedInputStream.html#available()" title="class or interface in java.io">available</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/BufferedInputStream.html" title="class or interface in java.io">BufferedInputStream</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of bytes that can be read from this input stream without blocking.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if an I/O error occurs.</DL></DD></DL><HR><A NAME="mark(int)"><!-- --></A><H3>mark</H3><PRE>public void <B>mark</B>(int readlimit)</PRE><DL><DD>See the general contract of the <code>mark</code> method of <code>InputStream</code>.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/BufferedInputStream.html#mark(int)" title="class or interface in java.io">mark</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/BufferedInputStream.html" title="class or interface in java.io">BufferedInputStream</A></CODE></DL></DD><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><A HREF="../../../javax/mail/util/SharedFileInputStream.html#reset()"><CODE>reset()</CODE></A></DL></DD></DL><HR><A NAME="reset()"><!-- --></A><H3>reset</H3><PRE>public void <B>reset</B>() throws <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>See the general contract of the <code>reset</code> method of <code>InputStream</code>. <p> If <code>markpos</code> is <code>-1</code> (no mark has been set or the mark has been invalidated), an <code>IOException</code> is thrown. Otherwise, <code>pos</code> is set equal to <code>markpos</code>.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/BufferedInputStream.html#reset()" title="class or interface in java.io">reset</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/BufferedInputStream.html" title="class or interface in java.io">BufferedInputStream</A></CODE></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if this stream has not been marked or if the mark has been invalidated.<DT><B>See Also:</B><DD><A HREF="../../../javax/mail/util/SharedFileInputStream.html#mark(int)"><CODE>mark(int)</CODE></A></DL></DD></DL><HR><A NAME="markSupported()"><!-- --></A><H3>markSupported</H3><PRE>public boolean <B>markSupported</B>()</PRE><DL><DD>Tests if this input stream supports the <code>mark</code> and <code>reset</code> methods. The <code>markSupported</code> method of <code>SharedFileInputStream</code> returns <code>true</code>.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/BufferedInputStream.html#markSupported()" title="class or interface in java.io">markSupported</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/BufferedInputStream.html" title="class or interface in java.io">BufferedInputStream</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <code>boolean</code> indicating if this stream type supports the <code>mark</code> and <code>reset</code> methods.<DT><B>See Also:</B><DD><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/InputStream.html#mark(int)" title="class or interface in java.io"><CODE>InputStream.mark(int)</CODE></A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/InputStream.html#reset()" title="class or interface in java.io"><CODE>InputStream.reset()</CODE></A></DL></DD></DL><HR><A NAME="close()"><!-- --></A><H3>close</H3><PRE>public void <B>close</B>() throws <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Closes this input stream and releases any system resources associated with the stream.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/Closeable.html#close()" title="class or interface in java.io">close</A></CODE> in interface <CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/Closeable.html" title="class or interface in java.io">Closeable</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/BufferedInputStream.html#close()" title="class or interface in java.io">close</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/BufferedInputStream.html" title="class or interface in java.io">BufferedInputStream</A></CODE></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if an I/O error occurs.</DL></DD></DL><HR><A NAME="getPosition()"><!-- --></A><H3>getPosition</H3><PRE>public long <B>getPosition</B>()</PRE><DL><DD>Return the current position in the InputStream, as an offset from the beginning of the InputStream.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/mail/internet/SharedInputStream.html#getPosition()">getPosition</A></CODE> in interface <CODE><A HREF="../../../javax/mail/internet/SharedInputStream.html" title="interface in javax.mail.internet">SharedInputStream</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the current position</DL></DD></DL><HR><A NAME="newStream(long, long)"><!-- --></A><H3>newStream</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/InputStream.html" title="class or interface in java.io">InputStream</A> <B>newStream</B>(long start, long end)</PRE><DL><DD>Return a new InputStream representing a subset of the data from this InputStream, starting at <code>start</code> (inclusive) up to <code>end</code> (exclusive). <code>start</code> must be non-negative. If <code>end</code> is -1, the new stream ends at the same place as this stream. The returned InputStream will also implement the SharedInputStream interface.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/mail/internet/SharedInputStream.html#newStream(long, long)">newStream</A></CODE> in interface <CODE><A HREF="../../../javax/mail/internet/SharedInputStream.html" title="interface in javax.mail.internet">SharedInputStream</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>start</CODE> - the starting position<DD><CODE>end</CODE> - the ending position + 1<DT><B>Returns:</B><DD>the new stream</DL></DD></DL><HR><A NAME="finalize()"><!-- --></A><H3>finalize</H3><PRE>protected void <B>finalize</B>() throws <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Throwable.html" title="class or interface in java.lang">Throwable</A></PRE><DL><DD>Force this stream to close.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></CODE></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Throwable.html" title="class or interface in java.lang">Throwable</A></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=2 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="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="../../../javax/mail/util/SharedByteArrayInputStream.html" title="class in javax.mail.util"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?javax/mail/util/SharedFileInputStream.html" target="_top"><B>FRAMES</B></A> <A HREF="SharedFileInputStream.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="#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><font size="-1"><a href="http://java.sun.com/webapps/bugreport">Submit a bug or feature</a> <p>Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../legal/license.html" target="_top">license terms.</a></font></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?