JavaScript is disabled on your browser.
All Implemented Interfaces:
EmuFileContents <byte[]>
A concrete in-memory bytes store for simulated file contents
Note that currently, the total contents cannot exceed a Java array, so the file must remain less
than 2GB in size.
Field Summary
Fields
protected byte[]
protected static final int
Constructor Summary
Constructors
Method Summary
All Methods Instance Methods Concrete Methods
long
read (long offset,
byte[] buf,
long fileSize)
Copy values from the file into the given buffer
void
long
write (long offset,
byte[] buf,
long curSize)
Write values from the given buffer into the file
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
Field Details
INIT_CONTENT_SIZE
protected static final int INIT_CONTENT_SIZE
See Also:
content
protected byte[] content
Constructor Details
BytesEmuFileContents
public BytesEmuFileContents ()
Method Details
read
public long read (long offset,
byte[] buf,
long fileSize)
Copy values from the file into the given buffer
Specified by:
read
in interface EmuFileContents <byte[]>
Parameters:
offset
- the offset in the file to read
buf
- the destination buffer, whose size must be known
fileSize
- the size of the file
Returns:
the number of bytes (not necessarily concrete) read
write
public long write (long offset,
byte[] buf,
long curSize)
Write values from the given buffer into the file
Specified by:
write
in interface EmuFileContents <byte[]>
Parameters:
offset
- the offset in the file to write
buf
- the source buffer, whose size must be known
curSize
- the current size of the file
Returns:
the number of bytes (not necessarily concrete) written
truncate
public void truncate ()
Erase the contents
Note that the file's size will be set to 0, so actual erasure of the contents may not be
necessary, but if the contents are expensive to store, they ought to be disposed.
Specified by:
truncate
in interface EmuFileContents <byte[]>