java.io.Closeable
, java.io.DataInput
, java.io.DataOutput
, java.lang.AutoCloseable
, java.nio.channels.ByteChannel
, java.nio.channels.Channel
, java.nio.channels.ReadableByteChannel
, java.nio.channels.SeekableByteChannel
, java.nio.channels.WritableByteChannel
public class CloseableRandomAccessFile extends FileAccess
_bufferSize, _dataInStream, _dataOutStream, _position, defaultBufferSize
Constructor | Description |
---|---|
CloseableRandomAccessFile(java.io.File file) |
|
CloseableRandomAccessFile(java.io.File file,
int bufferSize) |
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
|
void |
closeFile() |
Schließt die Datei auf Betriebssystemebene, aber erlaubt weitere Lese- und Schreibzugriffe.
|
protected java.nio.channels.FileChannel |
getChannel() |
Gibt einen gültigen FileChannel zurück, mit dem die Klasse die Datei manipulieren kann.
|
protected java.io.DataInputStream |
getDataInStream() |
Gibt einen DataInputStream zum Lesen zurück
|
protected java.io.DataOutputStream |
getDataOutStream() |
Gibt einen DataOutputStream zum Schreiben zurück
|
boolean |
isOpen() |
|
protected void |
openFile() |
flush, flushInStream, flushOutStream, getFilePointer, length, position, position, read, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, seek, setLength, size, skip, skipBytes, toString, truncate, write, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
public CloseableRandomAccessFile(java.io.File file)
public CloseableRandomAccessFile(java.io.File file, int bufferSize)
protected java.io.DataOutputStream getDataOutStream() throws java.io.IOException
FileAccess
getDataOutStream
in class FileAccess
java.io.IOException
protected java.io.DataInputStream getDataInStream() throws java.io.IOException
FileAccess
getDataInStream
in class FileAccess
java.io.IOException
protected final java.nio.channels.FileChannel getChannel() throws java.io.IOException
FileAccess
getChannel
in class FileAccess
java.io.IOException
protected void openFile() throws java.io.IOException
java.io.IOException
public boolean isOpen()
isOpen
in interface java.nio.channels.Channel
isOpen
in class FileAccess
public void close() throws java.io.IOException
close
in interface java.lang.AutoCloseable
close
in interface java.nio.channels.Channel
close
in interface java.io.Closeable
close
in class FileAccess
java.io.IOException
public void closeFile() throws java.io.IOException
java.io.IOException