right4_5_3.htm

来自「清华JAVA教程。不用多说了吧」· HTM 代码 · 共 39 行

HTM
39
字号
<html><head><title>JAVA编程语言</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><link rel="stylesheet" href="../../../css/text.css" type="text/css"></head><body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" ><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">  <tr>     <td valign="top">       <table width="96%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">        <tr>          <td valign="top">             <p class="pt9-black">   接口DataInput 中定义的方法主要包括从流中读取基本类型的数据、读取一行数据、或者读取指定长度的字节数。如:readBoolean(               )、readInt( )、readLine( )、readFully( ) 等。 <br>              <br>                接口DataOutput 中定义的方法主要是向流中写入基本类型的数据、或者写入一定长度的字节数组。如:writeChar(               )、writeDouble( )、write( ) 等。 下面详细介绍RandomAccessFile类中的方法。<br>              <br>               <b>◇ 构造方法:</b><br>                RandomAccessFile(String name,String mode); <font color="339900">//name是文件名,mode<br>                        //是打开方式,例如&quot;r&quot;表示只读,&quot;rw&quot;表示可读写,&quot;</font><br>                RandomAccessFile(File file,String mode); <font color="339900">//file是文件对象</font><br>              <br>               <b>◇ 文件指针的操作</b><br>                long getFilePointer( ); <font color="339900">//用于得到当前的文件指针</font><br>                void seek( long pos ); <font color="339900">//用于移动文件指针到指定的位置</font><br>                int skipBytes( int n ); <font color="339900">//使文件指针向前移动指定的n个字节</font><br>            </p>            </td>        </tr>      </table>    </td>  </tr></table></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?