Examples of UnallocatedSpaceDescriptor


Examples of com.github.stephenc.javaisotools.udflib.structures.UnallocatedSpaceDescriptor

                                                 long volumeDescriptorSequenceNumber, long targetBlock,
                                                 long unallocatedSpaceStartBlock, long unallocatedSpaceEndBlock,
                                                 int tagSerialNumber, byte[] udfVersionIdentifierSuffix,
                                                 int descriptorVersion)
            throws IOException {
        UnallocatedSpaceDescriptor myUnallocatedSpaceDescriptor = new UnallocatedSpaceDescriptor();

        myUnallocatedSpaceDescriptor.DescriptorTag.TagSerialNumber = tagSerialNumber;
        myUnallocatedSpaceDescriptor.DescriptorTag.DescriptorVersion = descriptorVersion;
        myUnallocatedSpaceDescriptor.DescriptorTag.TagLocation = targetBlock;

        myUnallocatedSpaceDescriptor.VolumeDescriptorSequenceNumber = volumeDescriptorSequenceNumber;
        myUnallocatedSpaceDescriptor.NumberofAllocationDescriptors = 1;
        myUnallocatedSpaceDescriptor.AllocationDescriptors = new Extend_ad[1];

        // unallocated space #1
        // TODO: extend method for describing more than one unallocated space area
        myUnallocatedSpaceDescriptor.AllocationDescriptors[0] = new Extend_ad();
        myUnallocatedSpaceDescriptor.AllocationDescriptors[0].loc = unallocatedSpaceStartBlock;
        myUnallocatedSpaceDescriptor.AllocationDescriptors[0].len =
                (unallocatedSpaceEndBlock - unallocatedSpaceStartBlock) * blockSize;

        myRandomAccessFile.seek(targetBlock * blockSize);
        myUnallocatedSpaceDescriptor.write(myRandomAccessFile, blockSize);
    }
View Full Code Here

Examples of com.github.stephenc.javaisotools.udflib.structures.UnallocatedSpaceDescriptor

                catch (IOException myIOException) {
                }
            }
        }

        UnallocatedSpaceDescriptor myUnallocatedSpaceDescriptor = new UnallocatedSpaceDescriptor();

        myUnallocatedSpaceDescriptor.VolumeDescriptorSequenceNumber = volumeDescriptorSequenceNumber;
        myUnallocatedSpaceDescriptor.NumberofAllocationDescriptors = 1;
        myUnallocatedSpaceDescriptor.AllocationDescriptors = new Extend_ad[1];

        myUnallocatedSpaceDescriptor.AllocationDescriptors[0] = new Extend_ad();
        myUnallocatedSpaceDescriptor.AllocationDescriptors[0].loc = unallocatedSpaceStartBlock;
        myUnallocatedSpaceDescriptor.AllocationDescriptors[0].len =
                (unallocatedSpaceEndBlock - unallocatedSpaceStartBlock) * blockSize;

        /*
          // full element with descriptor tag
          myUnallocatedSpaceDescriptor.DescriptorTag.TagSerialNumber = tagSerialNumber;
          myUnallocatedSpaceDescriptor.DescriptorTag.DescriptorVersion = descriptorVersion;
          myUnallocatedSpaceDescriptor.DescriptorTag.TagLocation = tagLocation;
          super.data( new ByteArrayDataReference( myUnallocatedSpaceDescriptor.getBytes( blockSize ) ) );
          */

        // without descriptor tag (handled in next pipeline section)
        super.startElement(new SabreUDFElement(SabreUDFElement.UDFElementType.DescriptorTag));
        super.data(new WordDataReference(7));                    // tag identifier
        super.data(new WordDataReference(tagLocation));            // tag location
        super.data(new WordDataReference(tagSerialNumber));        // tag serial number
        super.data(new WordDataReference(descriptorVersion));    // descriptor version
        super.data(new ByteArrayDataReference(myUnallocatedSpaceDescriptor.getBytesWithoutDescriptorTag()));
        super.endElement();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.