📄 datainputstream.html
字号:
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> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/DataInputStream.html#reset()">reset</A></B>()</CODE>
<BR>
Repositions this stream to the position at the time the <code>mark</code> method was last called on this input stream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/DataInputStream.html#skip(long)">skip</A></B>(long n)</CODE>
<BR>
Skips over and discards <code>n</code> bytes of data from the input stream.</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.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#equals(java.lang.Object)">equals</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 =========== -->
<A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="in"><!-- --></A><H3>
in</H3>
<PRE>
protected <A HREF="../../java/io/InputStream.html">InputStream</A> <B>in</B></PRE>
<DL>
<DD>The input stream.</DL>
<!-- ========= 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>DataInputStream</code> and saves its argument, the input stream <code>in</code>, for later use.<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()"><!-- --></A><H3>
read</H3>
<PRE>
public int <B>read</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></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.<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/InputStream.html#read()">read</A></CODE> in class <CODE><A HREF="../../java/io/InputStream.html">InputStream</A></CODE></DL>
</DD>
<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><A HREF="../../java/io/IOException.html">IOException</A></CODE> - if an I/O error occurs.</DL>
</DD>
</DL>
<HR>
<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/InputStream.html#read(byte[])">read</A></CODE> in class <CODE><A HREF="../../java/io/InputStream.html">InputStream</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/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>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.<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/InputStream.html#read(byte[], int, int)">read</A></CODE> in class <CODE><A HREF="../../java/io/InputStream.html">InputStream</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.</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.</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.</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.</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.</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.</DL>
</DD>
</DL>
<HR>
<A NAME="readShort()"><!-- --></A><H3>
readShort</H3>
<PRE>
public final short <B>readShort</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE>
<DL>
<DD>See the general contract of the <code>readShort</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#readShort()">readShort</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 a signed 16-bit number.<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="readUnsignedShort()"><!-- --></A><H3>
readUnsignedShort</H3>
<PRE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -