📄 datainputstream.html
字号:
method of <code>DataInput</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> short</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/io/DataInputStream.html#readShort()">readShort</A></B>()</CODE><BR> See the general contract of the <code>readShort</code> method of <code>DataInput</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/io/DataInputStream.html#readUnsignedByte()">readUnsignedByte</A></B>()</CODE><BR> See the general contract of the <code>readUnsignedByte</code> method of <code>DataInput</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/io/DataInputStream.html#readUnsignedShort()">readUnsignedShort</A></B>()</CODE><BR> See the general contract of the <code>readUnsignedShort</code> method of <code>DataInput</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/io/DataInputStream.html#readUTF()">readUTF</A></B>()</CODE><BR> See the general contract of the <code>readUTF</code> method of <code>DataInput</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/io/DataInputStream.html#readUTF(java.io.DataInput)">readUTF</A></B>(<A HREF="../../java/io/DataInput.html">DataInput</A> in)</CODE><BR> 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>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/io/DataInputStream.html#skipBytes(int)">skipBytes</A></B>(int n)</CODE><BR> See the general contract of the <code>skipBytes</code> method of <code>DataInput</code>.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.io.FilterInputStream"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.io.<A HREF="../../java/io/FilterInputStream.html">FilterInputStream</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/io/FilterInputStream.html#available()">available</A>, <A HREF="../../java/io/FilterInputStream.html#close()">close</A>, <A HREF="../../java/io/FilterInputStream.html#mark(int)">mark</A>, <A HREF="../../java/io/FilterInputStream.html#markSupported()">markSupported</A>, <A HREF="../../java/io/FilterInputStream.html#read()">read</A>, <A HREF="../../java/io/FilterInputStream.html#reset()">reset</A>, <A HREF="../../java/io/FilterInputStream.html#skip(long)">skip</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#toString()">toString</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="DataInputStream(java.io.InputStream)"><!-- --></A><H3>DataInputStream</H3><PRE>public <B>DataInputStream</B>(<A HREF="../../java/io/InputStream.html">InputStream</A> in)</PRE><DL><DD>Creates a <code>FilterInputStream</code> and saves its argument, the input stream <code>in</code>, for later use. An internal<DD><DL><DT><B>Parameters:</B><DD><CODE>in</CODE> - the input stream.</DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="read(byte[])"><!-- --></A><H3>read</H3><PRE>public final int <B>read</B>(byte[] b) throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>See the general contract of the <code>read</code> method of <code>DataInput</code>. <p> Bytes for this operation are read from the contained input stream.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/FilterInputStream.html#read(byte[])">read</A></CODE> in class <CODE><A HREF="../../java/io/FilterInputStream.html">FilterInputStream</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>b</CODE> - the buffer into which the data is 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><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/FilterInputStream.html#in"><CODE>FilterInputStream.in</CODE></A>, <A HREF="../../java/io/InputStream.html#read(byte[], int, int)"><CODE>InputStream.read(byte[], int, int)</CODE></A></DL></DD></DL><HR><A NAME="read(byte[], int, int)"><!-- --></A><H3>read</H3><PRE>public final int <B>read</B>(byte[] b, int off, int len) throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>See the general contract of the <code>read</code> method of <code>DataInput</code>. <p> Bytes for this operation are read from the contained input stream.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/FilterInputStream.html#read(byte[], int, int)">read</A></CODE> in class <CODE><A HREF="../../java/io/FilterInputStream.html">FilterInputStream</A></CODE></DL></DD><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><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/FilterInputStream.html#in"><CODE>FilterInputStream.in</CODE></A>, <A HREF="../../java/io/InputStream.html#read(byte[], int, int)"><CODE>InputStream.read(byte[], int, int)</CODE></A></DL></DD></DL><HR><A NAME="readFully(byte[])"><!-- --></A><H3>readFully</H3><PRE>public final void <B>readFully</B>(byte[] b) throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>See the general contract of the <code>readFully</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#readFully(byte[])">readFully</A></CODE> in interface <CODE><A HREF="../../java/io/DataInput.html">DataInput</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>b</CODE> - the buffer into which the data is read.<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/FilterInputStream.html#in"><CODE>FilterInputStream.in</CODE></A></DL></DD></DL><HR><A NAME="readFully(byte[], int, int)"><!-- --></A><H3>readFully</H3><PRE>public final void <B>readFully</B>(byte[] b, int off, int len) throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>See the general contract of the <code>readFully</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#readFully(byte[], int, int)">readFully</A></CODE> in interface <CODE><A HREF="../../java/io/DataInput.html">DataInput</A></CODE></DL></DD><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 number of bytes to read.<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/FilterInputStream.html#in"><CODE>FilterInputStream.in</CODE></A></DL></DD></DL><HR><A NAME="skipBytes(int)"><!-- --></A><H3>skipBytes</H3><PRE>public final int <B>skipBytes</B>(int n) throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>See the general contract of the <code>skipBytes</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#skipBytes(int)">skipBytes</A></CODE> in interface <CODE><A HREF="../../java/io/DataInput.html">DataInput</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="readBoolean()"><!-- --></A><H3>readBoolean</H3><PRE>public final boolean <B>readBoolean</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>See the general contract of the <code>readBoolean</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#readBoolean()">readBoolean</A></CODE> in interface <CODE><A HREF="../../java/io/DataInput.html">DataInput</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the <code>boolean</code> value read.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/EOFException.html">EOFException</A></CODE> - if this input stream has reached the end.<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/FilterInputStream.html#in"><CODE>FilterInputStream.in</CODE></A></DL></DD></DL><HR><A NAME="readByte()"><!-- --></A><H3>readByte</H3><PRE>public final byte <B>readByte</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>See the general contract of the <code>readByte</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#readByte()">readByte</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 byte of this input stream as a signed 8-bit <code>byte</code>.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/EOFException.html">EOFException</A></CODE> - if this input stream has reached the end.<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/FilterInputStream.html#in"><CODE>FilterInputStream.in</CODE></A></DL></DD></DL><HR><A NAME="readUnsignedByte()"><!-- --></A><H3>readUnsignedByte</H3><PRE>public final int <B>readUnsignedByte</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>See the general contract of the <code>readUnsignedByte</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#readUnsignedByte()">readUnsignedByte</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 byte of this input stream, interpreted as an unsigned 8-bit number.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/EOFException.html">EOFException</A></CODE> - if this input stream has reached the end.<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/FilterInputStream.html#in"><CODE>FilterInputStream.in</CODE></A></DL></DD>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -