Package com.github.stephenc.javaisotools.udflib.structures

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


        long metadataFileLength = 1 + recursiveGetMetadataFileLength(rootUDFImageBuilderFile, blockSize);
        if (metadataFileLength % metadataAllocationUnitSize != 0) {
            metadataFileLength += metadataAllocationUnitSize - (metadataFileLength % metadataAllocationUnitSize);
        }

        Short_ad metadataAllocationDescriptor = new Short_ad();
        metadataAllocationDescriptor.ExtentPosition = metadataPartitionStartingBlock - partitionStartingBlock;
        metadataAllocationDescriptor.ExtentLength = metadataFileLength * blockSize;

        metadataExtendedFileEntry.LogicalBlocksRecorded = metadataFileLength;
        metadataExtendedFileEntry.InformationLength = metadataFileLength * blockSize;
        metadataExtendedFileEntry.ObjectSize = metadataFileLength * blockSize;
        metadataExtendedFileEntry.AllocationDescriptors = metadataAllocationDescriptor.getBytes();
        metadataExtendedFileEntry.LengthofAllocationDescriptors =
                metadataExtendedFileEntry.AllocationDescriptors.length;

        // write main metadata file
        metadataExtendedFileEntry.DescriptorTag.TagLocation = mainMetadataFileBlock - partitionStartingBlock;
View Full Code Here


                myFileEntry.LogicalBlocksRecorded = (long) (directoryFileDataLength / blockSize);
                if (directoryFileDataLength % blockSize != 0) {
                    myFileEntry.LogicalBlocksRecorded++;
                }

                Short_ad allocationDescriptor = new Short_ad();

                allocationDescriptor.ExtentLength = directoryFileDataLength;
                allocationDescriptor.ExtentPosition = nextFreeBlock - partitionStartingBlock;

                long currentRealPosition = nextFreeBlock * blockSize;
                myRandomAccessFile.seek(currentRealPosition);

                for (int i = 0; i < childFileIdentifierDescriptors.size(); ++i) {
                    long tagLocationBlock = (long) (currentRealPosition / blockSize) - partitionStartingBlock;

                    FileIdentifierDescriptor childFileIdentifierDescriptor = childFileIdentifierDescriptors.get(i);

                    childFileIdentifierDescriptor.DescriptorTag.TagLocation = tagLocationBlock;

                    byte childFileIdentifierDescriptorBytes[] = childFileIdentifierDescriptors.get(i).getBytes();
                    myRandomAccessFile.write(childFileIdentifierDescriptorBytes);

                    currentRealPosition += childFileIdentifierDescriptorBytes.length;
                }

                nextFreeBlock += myFileEntry.LogicalBlocksRecorded;

                myFileEntry.AllocationDescriptors = allocationDescriptor.getBytes();
                myFileEntry.LengthofAllocationDescriptors = myFileEntry.AllocationDescriptors.length;
            }
        }

        /*
 
View Full Code Here

                myExtendedFileEntry.LogicalBlocksRecorded = (long) (directoryFileDataLength / blockSize);
                if (directoryFileDataLength % blockSize != 0) {
                    myExtendedFileEntry.LogicalBlocksRecorded++;
                }

                Short_ad allocationDescriptor = new Short_ad();

                allocationDescriptor.ExtentLength = directoryFileDataLength;
                allocationDescriptor.ExtentPosition = nextFreeBlocks[0] - metadataPartitionStartingBlock;

                long currentRealPosition = nextFreeBlocks[0] * blockSize;
                myRandomAccessFile.seek(currentRealPosition);

                for (int i = 0; i < childFileIdentifierDescriptors.size(); ++i) {
                    long tagLocationBlock = (long) (currentRealPosition / blockSize) - metadataPartitionStartingBlock;

                    FileIdentifierDescriptor childFileIdentifierDescriptor = childFileIdentifierDescriptors.get(i);

                    childFileIdentifierDescriptor.DescriptorTag.TagLocation = tagLocationBlock;

                    byte childFileIdentifierDescriptorBytes[] = childFileIdentifierDescriptors.get(i).getBytes();
                    myRandomAccessFile.write(childFileIdentifierDescriptorBytes);

                    currentRealPosition += childFileIdentifierDescriptorBytes.length;
                }

                nextFreeBlocks[0] += myExtendedFileEntry.LogicalBlocksRecorded;

                myExtendedFileEntry.AllocationDescriptors = allocationDescriptor.getBytes();
                myExtendedFileEntry.LengthofAllocationDescriptors = myExtendedFileEntry.AllocationDescriptors.length;
            }
        }

        /*
 
View Full Code Here

            myExtendedFileEntry.LogicalBlocksRecorded = (long) (directoryFileDataLength / blockSize);
            if (directoryFileDataLength % blockSize != 0) {
                myExtendedFileEntry.LogicalBlocksRecorded++;
            }

            Short_ad allocationDescriptor = new Short_ad();

            allocationDescriptor.ExtentLength = directoryFileDataLength;
            allocationDescriptor.ExtentPosition = dataLocation;

            if (directoryFileDataLength % blockSize != 0) {
                directoryFileDataLength += blockSize - (directoryFileDataLength % blockSize);

            }
            byte[] data = new byte[directoryFileDataLength];

            long currentRealPosition = dataLocation * blockSize;
            int pos = 0;

            for (int i = 0; i < childFileIdentifierDescriptors.size(); ++i) {
                long tagLocationBlock = (long) (currentRealPosition / blockSize);

                FileIdentifierDescriptor childFileIdentifierDescriptor = childFileIdentifierDescriptors.get(i);

                childFileIdentifierDescriptor.DescriptorTag.TagLocation = tagLocationBlock;

                byte childFileIdentifierDescriptorBytes[] = childFileIdentifierDescriptors.get(i).getBytes();

                System.arraycopy(childFileIdentifierDescriptorBytes, 0, data, pos,
                        childFileIdentifierDescriptorBytes.length);
                pos += childFileIdentifierDescriptorBytes.length;

                currentRealPosition += childFileIdentifierDescriptorBytes.length;
            }

            myExtendedFileEntry.AllocationDescriptors = allocationDescriptor.getBytes();
            myExtendedFileEntry.LengthofAllocationDescriptors = myExtendedFileEntry.AllocationDescriptors.length;

            /*
               // full element with descriptor tag
               super.data( new ByteArrayDataReference( myExtendedFileEntry.getBytes( blockSize ) ) );
View Full Code Here

        metadataExtendedFileEntry.ICBTag.NumberofEntries = 1;
        metadataExtendedFileEntry.ICBTag.StrategyType = 4;

        long metadataFileLength = (metadataPartitionEndingBlock - metadataPartitionStartingBlock);

        Short_ad metadataAllocationDescriptor = new Short_ad();
        metadataAllocationDescriptor.ExtentPosition = metadataPartitionStartingBlock - physicalPartitionStartingBlock;
        metadataAllocationDescriptor.ExtentLength = metadataFileLength * blockSize;

        metadataExtendedFileEntry.LogicalBlocksRecorded = metadataFileLength;
        metadataExtendedFileEntry.InformationLength = metadataFileLength * blockSize;
        metadataExtendedFileEntry.ObjectSize = metadataFileLength * blockSize;
        metadataExtendedFileEntry.AllocationDescriptors = metadataAllocationDescriptor.getBytes();
        metadataExtendedFileEntry.LengthofAllocationDescriptors =
                metadataExtendedFileEntry.AllocationDescriptors.length;

        metadataExtendedFileEntry.DescriptorTag.TagLocation = metadataFileLocation;
        metadataExtendedFileEntry.ICBTag.FileType = fileType;
View Full Code Here

            myFileEntry.LogicalBlocksRecorded = (long) (directoryFileDataLength / blockSize);
            if (directoryFileDataLength % blockSize != 0) {
                myFileEntry.LogicalBlocksRecorded++;
            }

            Short_ad allocationDescriptor = new Short_ad();

            allocationDescriptor.ExtentLength = directoryFileDataLength;
            allocationDescriptor.ExtentPosition = dataLocation;

            if (directoryFileDataLength % blockSize != 0) {
                directoryFileDataLength += blockSize - (directoryFileDataLength % blockSize);

            }
            byte[] data = new byte[directoryFileDataLength];

            long currentRealPosition = dataLocation * blockSize;
            int pos = 0;

            for (int i = 0; i < childFileIdentifierDescriptors.size(); ++i) {
                long tagLocationBlock = (long) (currentRealPosition / blockSize);

                FileIdentifierDescriptor childFileIdentifierDescriptor = childFileIdentifierDescriptors.get(i);

                childFileIdentifierDescriptor.DescriptorTag.TagLocation = tagLocationBlock;

                byte childFileIdentifierDescriptorBytes[] = childFileIdentifierDescriptors.get(i).getBytes();

                System.arraycopy(childFileIdentifierDescriptorBytes, 0, data, pos,
                        childFileIdentifierDescriptorBytes.length);
                pos += childFileIdentifierDescriptorBytes.length;

                currentRealPosition += childFileIdentifierDescriptorBytes.length;
            }

            myFileEntry.AllocationDescriptors = allocationDescriptor.getBytes();
            myFileEntry.LengthofAllocationDescriptors = myFileEntry.AllocationDescriptors.length;

            /*
               // full element with descriptor tag
               super.data( new ByteArrayDataReference( myFileEntry.getBytes( blockSize ) ) );
View Full Code Here

TOP

Related Classes of com.github.stephenc.javaisotools.udflib.structures.Short_ad

Copyright © 2018 www.massapicom. 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.