Package org.apache.commons.io
Class IORandomAccessFile
- java.lang.Object
-
- java.io.RandomAccessFile
-
- org.apache.commons.io.IORandomAccessFile
-
- All Implemented Interfaces:
java.io.Closeable,java.io.DataInput,java.io.DataOutput,java.lang.AutoCloseable
public final class IORandomAccessFile extends java.io.RandomAccessFile
ExtendsRandomAccessFileto provide access to theFileandmodepassed on construction.- Since:
- 2.18.0
- See Also:
RandomAccessFile,RandomAccessFileMode
-
-
Constructor Summary
Constructors Constructor Description IORandomAccessFile(java.io.File file, java.lang.String mode)Constructs a new instance by callingRandomAccessFile(File, String).IORandomAccessFile(java.lang.String name, java.lang.String mode)Constructs a new instance by callingRandomAccessFile(String, String).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.FilegetFile()Gets the file passed toIORandomAccessFile(File, String).java.lang.StringgetMode()Gets the mode passed toIORandomAccessFile(File, String).java.lang.StringtoString()Returns the pathname string of this abstract pathname.-
Methods inherited from class java.io.RandomAccessFile
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
-
-
-
-
Constructor Detail
-
IORandomAccessFile
public IORandomAccessFile(java.io.File file, java.lang.String mode) throws java.io.FileNotFoundException
Constructs a new instance by callingRandomAccessFile(File, String).- Parameters:
file- the file objectmode- the access mode, as described inRandomAccessFile(File, String).- Throws:
java.io.FileNotFoundException- Thrown byRandomAccessFile(File, String).- See Also:
RandomAccessFile(File, String)
-
IORandomAccessFile
public IORandomAccessFile(java.lang.String name, java.lang.String mode) throws java.io.FileNotFoundException
Constructs a new instance by callingRandomAccessFile(String, String).- Parameters:
name- the file objectmode- the access mode, as described inRandomAccessFile(String, String).- Throws:
java.io.FileNotFoundException- Thrown byRandomAccessFile(String, String).- See Also:
RandomAccessFile(String, String)
-
-
Method Detail
-
getFile
public java.io.File getFile()
Gets the file passed toIORandomAccessFile(File, String).- Returns:
- the file passed to
IORandomAccessFile(File, String).
-
getMode
public java.lang.String getMode()
Gets the mode passed toIORandomAccessFile(File, String).- Returns:
- the mode passed to
IORandomAccessFile(File, String).
-
toString
public java.lang.String toString()
Returns the pathname string of this abstract pathname. This is just the string returned by theFile.toString()method.- Overrides:
toStringin classjava.lang.Object- Returns:
- The string form of the File's abstract pathname.
- See Also:
File.toString()
-
-