📄 datainputstream.html
字号:
public final int <B>readUnsignedShort</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE>
<DL>
<DD>See the general contract of the <code>readUnsignedShort</code> method of <code>DataInput</code>. <p> Bytes for this operation are read from the contained input stream.<DD><DL>
<DT><B>Specified by: </B><DD><CODE><A HREF="../../java/io/DataInput.html#readUnsignedShort()">readUnsignedShort</A></CODE> in interface <CODE><A HREF="../../java/io/DataInput.html">DataInput</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the next two bytes of this input stream, interpreted as an unsigned 16-bit integer.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/EOFException.html">EOFException</A></CODE> - if this input stream reaches the end before reading two bytes.<DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - if an I/O error occurs.</DL>
</DD>
</DL>
<HR>
<A NAME="readChar()"><!-- --></A><H3>
readChar</H3>
<PRE>
public final char <B>readChar</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE>
<DL>
<DD>See the general contract of the <code>readChar</code> method of <code>DataInput</code>. <p> Bytes for this operation are read from the contained input stream.<DD><DL>
<DT><B>Specified by: </B><DD><CODE><A HREF="../../java/io/DataInput.html#readChar()">readChar</A></CODE> in interface <CODE><A HREF="../../java/io/DataInput.html">DataInput</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the next two bytes of this input stream as a Unicode character.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/EOFException.html">EOFException</A></CODE> - if this input stream reaches the end before reading two bytes.<DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - if an I/O error occurs.</DL>
</DD>
</DL>
<HR>
<A NAME="readInt()"><!-- --></A><H3>
readInt</H3>
<PRE>
public final int <B>readInt</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE>
<DL>
<DD>See the general contract of the <code>readInt</code> method of <code>DataInput</code>. <p> Bytes for this operation are read from the contained input stream.<DD><DL>
<DT><B>Specified by: </B><DD><CODE><A HREF="../../java/io/DataInput.html#readInt()">readInt</A></CODE> in interface <CODE><A HREF="../../java/io/DataInput.html">DataInput</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the next four bytes of this input stream, interpreted as an <code>int</code>.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/EOFException.html">EOFException</A></CODE> - if this input stream reaches the end before reading four bytes.<DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - if an I/O error occurs.</DL>
</DD>
</DL>
<HR>
<A NAME="readLong()"><!-- --></A><H3>
readLong</H3>
<PRE>
public final long <B>readLong</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE>
<DL>
<DD>See the general contract of the <code>readLong</code> method of <code>DataInput</code>. <p> Bytes for this operation are read from the contained input stream.<DD><DL>
<DT><B>Specified by: </B><DD><CODE><A HREF="../../java/io/DataInput.html#readLong()">readLong</A></CODE> in interface <CODE><A HREF="../../java/io/DataInput.html">DataInput</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the next eight bytes of this input stream, interpreted as a <code>long</code>.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/EOFException.html">EOFException</A></CODE> - if this input stream reaches the end before reading eight bytes.<DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - if an I/O error occurs.</DL>
</DD>
</DL>
<HR>
<A NAME="readUTF()"><!-- --></A><H3>
readUTF</H3>
<PRE>
public final <A HREF="../../java/lang/String.html">String</A> <B>readUTF</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE>
<DL>
<DD>See the general contract of the <code>readUTF</code> method of <code>DataInput</code>. <p> Bytes for this operation are read from the contained input stream.<DD><DL>
<DT><B>Specified by: </B><DD><CODE><A HREF="../../java/io/DataInput.html#readUTF()">readUTF</A></CODE> in interface <CODE><A HREF="../../java/io/DataInput.html">DataInput</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>a Unicode string.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/EOFException.html">EOFException</A></CODE> - if this input stream reaches the end before reading all the bytes.<DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - if an I/O error occurs.<DT><B>See Also: </B><DD><A HREF="../../java/io/DataInputStream.html#readUTF(java.io.DataInput)"><CODE>readUTF(java.io.DataInput)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="readUTF(java.io.DataInput)"><!-- --></A><H3>
readUTF</H3>
<PRE>
public static final <A HREF="../../java/lang/String.html">String</A> <B>readUTF</B>(<A HREF="../../java/io/DataInput.html">DataInput</A> in) throws <A HREF="../../java/io/IOException.html">IOException</A></PRE>
<DL>
<DD>Reads from the stream <code>in</code> a representation of a Unicode character string encoded in Java modified UTF-8 format; this string of characters is then returned as a <code>String</code>. The details of the modified UTF-8 representation are exactly the same as for the <code>readUTF</code> method of <code>DataInput</code>.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>in</CODE> - a data input stream.<DT><B>Returns:</B><DD>a Unicode string.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/EOFException.html">EOFException</A></CODE> - if the input stream reaches the end before all the bytes.<DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - if an I/O error occurs.<DD><CODE><A HREF="../../java/io/UTFDataFormatException.html">UTFDataFormatException</A></CODE> - if the bytes do not represent a valid UTF-8 encoding of a Unicode string.<DT><B>See Also: </B><DD><A HREF="../../java/io/DataInputStream.html#readUnsignedShort()"><CODE>readUnsignedShort()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="skip(long)"><!-- --></A><H3>
skip</H3>
<PRE>
public long <B>skip</B>(long n) throws <A HREF="../../java/io/IOException.html">IOException</A></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>.<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/InputStream.html#skip(long)">skip</A></CODE> in class <CODE><A HREF="../../java/io/InputStream.html">InputStream</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="../../java/io/IOException.html">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="../../java/io/IOException.html">IOException</A></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.<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/InputStream.html#available()">available</A></CODE> in class <CODE><A HREF="../../java/io/InputStream.html">InputStream</A></CODE></DL>
</DD>
<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><A HREF="../../java/io/IOException.html">IOException</A></CODE> - if an I/O error occurs.</DL>
</DD>
</DL>
<HR>
<A NAME="close()"><!-- --></A><H3>
close</H3>
<PRE>
public void <B>close</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE>
<DL>
<DD>Closes this input stream and releases any system resources associated with the stream. This method simply performs <code>in.close()</code>.<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/InputStream.html#close()">close</A></CODE> in class <CODE><A HREF="../../java/io/InputStream.html">InputStream</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/IOException.html">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>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>.<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/InputStream.html#mark(int)">mark</A></CODE> in class <CODE><A HREF="../../java/io/InputStream.html">InputStream</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.</DL>
</DD>
</DL>
<HR>
<A NAME="reset()"><!-- --></A><H3>
reset</H3>
<PRE>
public void <B>reset</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></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.<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/InputStream.html#reset()">reset</A></CODE> in class <CODE><A HREF="../../java/io/InputStream.html">InputStream</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - if the stream has not been marked or if the mark has been invalidated.</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. This method simply performs <code>in.markSupported()</code>.<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/InputStream.html#markSupported()">markSupported</A></CODE> in class <CODE><A HREF="../../java/io/InputStream.html">InputStream</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD><code>true</code> if this stream type supports the <code>mark</code> and <code>reset</code> method; <code>false</code> otherwise.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<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/DataInputStream.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>
<strong>MID Profile</strong></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../java/io/ByteArrayOutputStream.html"><B>PREV CLASS</B></A>
<A HREF="../../java/io/DataOutputStream.html"><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="DataInputStream.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | <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>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<font size="-1"><a href="mailto:midp-feedback@risc.sps.mot.com">Submit a comment or suggestion</a> Version 2.0 of MID Profile Specification<br>Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries. Copyright (c) 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road,Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -