📄 objectinputstream.html
字号:
</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 without blocking.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/io/ObjectInput.html#available()">available</A></CODE> in interface <CODE><A HREF="../../java/io/ObjectInput.html">ObjectInput</A></CODE><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 available bytes.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - if there are I/O errors while reading from the underlying <code>InputStream</code></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 the input stream. Must be called to release any resources associated with the stream.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/io/ObjectInput.html#close()">close</A></CODE> in interface <CODE><A HREF="../../java/io/ObjectInput.html">ObjectInput</A></CODE><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 has occurred.</DL></DD></DL><HR><A NAME="readBoolean()"><!-- --></A><H3>readBoolean</H3><PRE>public boolean <B>readBoolean</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>Reads in a boolean.<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 boolean read.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/EOFException.html">EOFException</A></CODE> - If end of file is reached.<DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - If other I/O error has occurred.</DL></DD></DL><HR><A NAME="readByte()"><!-- --></A><H3>readByte</H3><PRE>public byte <B>readByte</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>Reads an 8 bit byte.<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 8 bit byte read.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/EOFException.html">EOFException</A></CODE> - If end of file is reached.<DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - If other I/O error has occurred.</DL></DD></DL><HR><A NAME="readUnsignedByte()"><!-- --></A><H3>readUnsignedByte</H3><PRE>public int <B>readUnsignedByte</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>Reads an unsigned 8 bit byte.<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 8 bit byte read.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/EOFException.html">EOFException</A></CODE> - If end of file is reached.<DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - If other I/O error has occurred.</DL></DD></DL><HR><A NAME="readShort()"><!-- --></A><H3>readShort</H3><PRE>public short <B>readShort</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>Reads a 16 bit short.<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 16 bit short read.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/EOFException.html">EOFException</A></CODE> - If end of file is reached.<DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - If other I/O error has occurred.</DL></DD></DL><HR><A NAME="readUnsignedShort()"><!-- --></A><H3>readUnsignedShort</H3><PRE>public int <B>readUnsignedShort</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>Reads an unsigned 16 bit short.<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 16 bit short read.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/EOFException.html">EOFException</A></CODE> - If end of file is reached.<DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - If other I/O error has occurred.</DL></DD></DL><HR><A NAME="readChar()"><!-- --></A><H3>readChar</H3><PRE>public char <B>readChar</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>Reads a 16 bit char.<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 16 bit char read.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/EOFException.html">EOFException</A></CODE> - If end of file is reached.<DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - If other I/O error has occurred.</DL></DD></DL><HR><A NAME="readInt()"><!-- --></A><H3>readInt</H3><PRE>public int <B>readInt</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>Reads a 32 bit int.<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 32 bit integer read.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/EOFException.html">EOFException</A></CODE> - If end of file is reached.<DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - If other I/O error has occurred.</DL></DD></DL><HR><A NAME="readLong()"><!-- --></A><H3>readLong</H3><PRE>public long <B>readLong</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>Reads a 64 bit long.<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 read 64 bit long.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/EOFException.html">EOFException</A></CODE> - If end of file is reached.<DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - If other I/O error has occurred.</DL></DD></DL><HR><A NAME="readFloat()"><!-- --></A><H3>readFloat</H3><PRE>public float <B>readFloat</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>Reads a 32 bit float.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/io/DataInput.html#readFloat()">readFloat</A></CODE> in interface <CODE><A HREF="../../java/io/DataInput.html">DataInput</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the 32 bit float read.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/EOFException.html">EOFException</A></CODE> - If end of file is reached.<DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - If other I/O error has occurred.</DL></DD></DL><HR><A NAME="readDouble()"><!-- --></A><H3>readDouble</H3><PRE>public double <B>readDouble</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>Reads a 64 bit double.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/io/DataInput.html#readDouble()">readDouble</A></CODE> in interface <CODE><A HREF="../../java/io/DataInput.html">DataInput</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the 64 bit double read.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/EOFException.html">EOFException</A></CODE> - If end of file is reached.<DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - If other I/O error has occurred.</DL></DD></DL><HR><A NAME="readFully(byte[])"><!-- --></A><H3>readFully</H3><PRE>public void <B>readFully</B>(byte[] data) throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>Reads bytes, blocking until all bytes are read.<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>data</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 end of file is reached.<DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - If other I/O error has occurred.</DL></DD></DL><HR><A NAME="readFully(byte[], int, int)"><!-- --></A><H3>readFully</H3><PRE>public void <B>readFully</B>(byte[] data, int offset, int size) throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>Reads bytes, blocking until all bytes are read.<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>data</CODE> - the buffer into which the data is read<DD><CODE>offset</CODE> - the start offset of the data<DD><CODE>size</CODE> - the maximum number of bytes to read<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/EOFException.html">EOFException</A></CODE> - If end of file is reached.<DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - If other I/O error has occurred.</DL></DD></DL><HR><A NAME="skipBytes(int)"><!-- --></A><H3>skipBytes</H3><PRE>public int <B>skipBytes</B>(int len) throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>Skips bytes, block until all bytes are skipped.<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>len</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/EOFException.html">EOFException</A></CODE> - If end of file is reached.<DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - If other I/O error has occurred.</DL></DD></DL><HR><A NAME="readLine()"><!-- --></A><H3>readLine</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>readLine</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD><B>Deprecated.</B> <I>This method does not properly convert bytes to characters. see DataInputStream for the details and alternatives.</I><P><DD>Reads in a line that has been terminated by a \n, \r, \r\n or EOF.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/io/DataInput.html#readLine()">readLine</A></CODE> in interf
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -