public class RandomAccessDisk extends java.lang.Object implements RandomAccess, Concatenable
RandomAccess
Interface als
RandomAccessFile
.RandomAccessMemory
Constructor and Description |
---|
RandomAccessDisk(java.io.File file,
boolean readonly) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Setzt zurueck und gibt ggf. verbrauchte Resourcen wieder frei.
|
void |
close()
Close this stream.
|
void |
concatFile(java.io.File file,
long skip)
Fuegt eine Datei binaer an.
|
long |
getReadIndex() |
long |
getWriteIndex() |
boolean |
isEof() |
byte |
readByte() |
int |
readBytes(byte[] buffer)
Liest ab der aktuellen Lese-Position Bytes
in den Puffer bis dieser voll ist oder EOF
erreicht wurde.
|
int |
readInt() |
long |
readLong() |
short |
readShort() |
void |
setReadIndex(long index) |
void |
setWriteIndex(long index) |
void |
setWriteIndexEof()
Setzt die Schreibposition wieder ans Ende.
|
void |
skip(long n) |
void |
writeByte(byte b) |
void |
writeBytes(byte[] bytes,
int len)
Schreibt das ByteArray in den Stream an die
aktuelle Schreibposition.
|
void |
writeInt(int i) |
void |
writeLong(long l) |
void |
writeShort(short s) |
public void concatFile(java.io.File file, long skip)
Concatenable
concatFile
in interface Concatenable
file
- File
skip
- long, 0 = Datei-Anfang der Quelldatei.public void clear()
RandomWrite
clear
in interface RandomWrite
public void close()
InStream
public long getReadIndex()
getReadIndex
in interface InStream
public long getWriteIndex()
getWriteIndex
in interface OutStream
public void setReadIndex(long index)
setReadIndex
in interface RandomRead
index
- Setzt die aktuelle Leseposition.public void setWriteIndexEof()
RandomWrite
setWriteIndexEof
in interface RandomWrite
public void setWriteIndex(long index)
setWriteIndex
in interface RandomWrite
index
- Setzt die aktuelle Schreibposition.public byte readByte()
public short readShort()
public int readInt()
public long readLong()
public void writeByte(byte b)
public void writeShort(short s)
writeShort
in interface OutStream
s
- Schreibt diesen short in den Stream.public void writeInt(int i)
public void writeLong(long l)
public int readBytes(byte[] buffer)
InStream
readBytes
in interface InStream
buffer
- byte[] Puffer.public void writeBytes(byte[] bytes, int len)
OutStream
writeBytes
in interface OutStream
bytes
- byte[] Bytes.len
- Anzahl zu Schreibender bytes.