public class RandomAccessFile
extends java.io.RandomAccessFile
追加したメソッドは以下のとおりです。 ●シークに関するもの ●基本データ型を読み込むもの(従来のものはビックエンディアンなので,リトルエンディアンのものを追加)
コンストラクタと説明 |
---|
RandomAccessFile(java.io.File file,
java.lang.String mode) |
RandomAccessFile(java.lang.String name,
java.lang.String mode) |
修飾子とタイプ | メソッドと説明 |
---|---|
long |
readIntFromByte()
現在のポインターからintの値を読み込みます。
|
long |
readLongFromByte()
現在のポインターからlongの値を読み込みます。
|
void |
seekFromCurrent(long pos)
現在のポインターから指定したバイト数だけポインタをシークさせます。
|
void |
seekFromEnd(long pos)
リソースの末尾からシークします。
|
close, getChannel, getFD, getFilePointer, length, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, seek, setLength, skipBytes, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
public RandomAccessFile(java.lang.String name, java.lang.String mode) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public RandomAccessFile(java.io.File file, java.lang.String mode) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public void seekFromEnd(long pos) throws java.io.IOException
pos
- 末尾からの位置。マイナスで指定。java.io.IOException
- I/Oエラー発生時public void seekFromCurrent(long pos) throws java.io.IOException
pos
- プラスの値の場合は後,マイナスの値の場合は前にシークjava.io.IOException
- I/Oエラー発生時public long readLongFromByte() throws java.io.IOException
java.io.IOException
- I/Oエラー発生時public long readIntFromByte() throws java.io.IOException
java.io.IOException
- I/Oエラー発生時