import java.io.*;

public class Random2{
	public static void main(String[] args){
		RandomAccessFile rf=null;

		try {
			rf=new RandomAccessFile("test.txt","r");
			System.out.println(rf.readShort());
			rf.seek(23);//想一想23是如何计算出来的?
			String n=rf.readUTF();
			System.out.println(n);
			System.out.println(rf.getFilePointer());
		}catch(IOException e){
			e.printStackTrace();
		}finally{
			if(rf!=null){
				try{
					rf.close();
				}catch(IOException e){
					e.printStackTrace();
				}
			}
		}
	}
}
