public class IMediumIO extends IUnknown
IMedium.openForIO(Boolean,String)
.
Interface ID: {E4B301A9-5F86-4D65-AD1B-87CA284FB1C8}
Constructor and Description |
---|
IMediumIO(java.lang.String wrapped,
org.virtualbox_7_0.ObjectRefManager objMgr,
org.virtualbox_7_0.jaxws.VboxPortType port) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Explictly close the medium I/O rather than waiting for garbage
collection and the destructor.
|
IProgress |
convertToStream(java.lang.String format,
java.util.List<MediumVariant> variant,
java.lang.Long bufferSize,
Holder<IDataStream> stream)
Converts the currently opened image into a stream of the specified
image type/variant.
|
void |
formatFAT(java.lang.Boolean quick)
Formats the medium as FAT.
|
IVFSExplorer |
getExplorer()
Returns the virtual file system explorer for the medium.
|
IMedium |
getMedium()
The open medium.
|
java.lang.Boolean |
getWritable()
Whether the medium can be written to.
|
void |
initializePartitionTable(PartitionTableType format,
java.lang.Boolean wholeDiskInOneEntry)
Writes an empty partition table to the disk.
|
static IMediumIO |
queryInterface(IUnknown obj) |
byte[] |
read(java.lang.Long offset,
java.lang.Long size)
Read data from the medium.
|
java.lang.Long |
write(java.lang.Long offset,
byte[] data)
Write data to the medium.
|
getObjMgr, getRemoteWSPort, getWrapped, releaseRemote
public IMediumIO(java.lang.String wrapped, org.virtualbox_7_0.ObjectRefManager objMgr, org.virtualbox_7_0.jaxws.VboxPortType port)
public IMedium getMedium()
public java.lang.Boolean getWritable()
public IVFSExplorer getExplorer()
public byte[] read(java.lang.Long offset, java.lang.Long size)
offset
- The byte offset into the medium to start reading at.size
- How many bytes to try read.public java.lang.Long write(java.lang.Long offset, byte[] data)
offset
- The byte offset into the medium to start reading at.data
- Array of data to write.public void formatFAT(java.lang.Boolean quick)
quick
- Quick format it when set.public void initializePartitionTable(PartitionTableType format, java.lang.Boolean wholeDiskInOneEntry)
format
- The partition table format.wholeDiskInOneEntry
- When true a partition table entry for the whole disk is created.
Otherwise the partition table is empty.public IProgress convertToStream(java.lang.String format, java.util.List<MediumVariant> variant, java.lang.Long bufferSize, Holder<IDataStream> stream)
VBOX_E_NOT_SUPPORTED
- The requested format/variant combination cannot handle stream output.VBOX_E_FILE_ERROR
- An error occurred during the conversion.format
- Identifier of the storage format to use for output.variant
- The partition table format.bufferSize
- Requested buffer size (in bytes) for efficient conversion. Sizes
which are too small or too large are silently truncated to suitable
values. Tens to hundreds of Megabytes are a good choice.stream
- Data stream object for reading the target image.public void close()