My code currently use RandomAccessFile to read a ZIP file. The code is taken from a open source
project. I need to make RANDOM Access File operation in memory without creating a physical File in
the disk. So need to replace functionality of RandomAccess File with FileOutput Stream.
The way Random Access File object Create.
protected RandomAccessFile file;
public ExtRandomAccessFile(File zipFile) throws IOException {
this.file = new RandomAccessFile(zipFile, "r");
}
Usage access different position mapped to the Random Access File
int censig = raFile.readInt( fileOffset );
short fileNameLength = raFile.readShort( fileOffset + 28 );
short extraFieldLength = raFile.readShort( fileOffset + 30 );
long fileOffsetPos = fileOffset + 28 + 14;
long fileDataOffset = raFile.readInt( fileOffsetPos );
int locsig = raFile.readInt( fileDataOffset );
Please advice me how do I replace my code with FileOutputstream. What is the
mechanism I should use to look up for values.
Thanks