tagLocation = BinaryTools.readUInt32AsLong(myInputStream);
myInputStream.close();
myInputStream = null;
}
catch (IOException myIOException) {
throw new HandlerException(myIOException);
}
finally {
if (myInputStream != null) {
try {
myInputStream.close();
}
catch (IOException myIOException) {
}
}
}
LogicalVolumeDescriptor myLogicalVolumeDescriptor = new LogicalVolumeDescriptor();
try {
myLogicalVolumeDescriptor.VolumeDescriptorSequenceNumber = volumeDescriptorSequenceNumber;
myLogicalVolumeDescriptor.setLogicalVolumeIdentifier(imageIdentifier);
myLogicalVolumeDescriptor.LogicalBlockSize = blockSize;
myLogicalVolumeDescriptor.DomainIdentifier.setIdentifier("*OSTA UDF Compliant");
myLogicalVolumeDescriptor.DomainIdentifier.IdentifierSuffix = udfVersionIdentifierSuffix;
myLogicalVolumeDescriptor.LogicalVolumeContentsUse.ExtentLength = blockSize;
myLogicalVolumeDescriptor.LogicalVolumeContentsUse.ExtentLocation.part_num = fileSetDescriptorPartition;
myLogicalVolumeDescriptor.LogicalVolumeContentsUse.ExtentLocation.lb_num = fileSetDescriptorLocation;
myLogicalVolumeDescriptor.ImplementationIdentifier.setIdentifier(applicationIdentifier);
myLogicalVolumeDescriptor.ImplementationIdentifier.IdentifierSuffix = applicationIdentifierSuffix;
// partition map type 1, length 6, volume sequence number 0, partition number 0
PartitionMapType1 myPartitionMapType1 = new PartitionMapType1();
byte myPartitionMapType1Bytes[] = myPartitionMapType1.getBytes();
if (mainMetadataFileLocation > 0) {
PartitionMapType2 myPartitionMapType2 = new PartitionMapType2();
EntityID partitionTypeIdentifier = new EntityID();
partitionTypeIdentifier.setIdentifier("*UDF Metadata Partition");
partitionTypeIdentifier.IdentifierSuffix = udfVersionIdentifierSuffix;
myPartitionMapType2.setupMetadataPartitionMap(partitionTypeIdentifier, 1, 0, mainMetadataFileLocation,
mirrorMetadataFileLocation, 0xFFFFFFFF, metadataAllocationUnitSize, metadataAlignmentUnitSize,
(byte) 0);
byte myPartitionMapType2Bytes[] = myPartitionMapType2.getBytes();
myLogicalVolumeDescriptor.NumberofPartitionMaps = 2;
myLogicalVolumeDescriptor.PartitionMaps =
new byte[myPartitionMapType1Bytes.length + myPartitionMapType2Bytes.length];
System.arraycopy(myPartitionMapType1Bytes, 0, myLogicalVolumeDescriptor.PartitionMaps, 0,
myPartitionMapType1Bytes.length);
System.arraycopy(myPartitionMapType2Bytes, 0, myLogicalVolumeDescriptor.PartitionMaps, 6,
myPartitionMapType2Bytes.length);
} else {
myLogicalVolumeDescriptor.NumberofPartitionMaps = 1;
myLogicalVolumeDescriptor.PartitionMaps = myPartitionMapType1Bytes;
}
}
catch (Exception myException) {
throw new HandlerException(myException);
}
myLogicalVolumeDescriptor.MapTableLength = myLogicalVolumeDescriptor.PartitionMaps.length;
myLogicalVolumeDescriptor.IntegritySequenceExtent.loc = logicalVolumeIntegritySequenceStartingBlock;