Package com.github.stephenc.javaisotools.sabre.impl

Examples of com.github.stephenc.javaisotools.sabre.impl.ByteDataReference


        myStreamHandler.data(new ByteArrayDataReference(applicationIdentifierSuffix));
        myStreamHandler.data(new WordDataReference(myUDFLayoutInformation.metadataPartitionStartingBlock));
        myStreamHandler.data(new WordDataReference(myUDFLayoutInformation.metadataPartitionEndingBlock));
        myStreamHandler.data(new WordDataReference(myUDFLayoutInformation.physicalPartitionStartingBlock));
        myStreamHandler.data(new WordDataReference(metadataFileLocation));
        myStreamHandler.data(new ByteDataReference(fileType));
    }
View Full Code Here


    public void doValidationEntry(int platformID, String idString) throws HandlerException {
        int sum = 0;

        // Header ID (0x01)
        streamHandler.data(new ByteDataReference(1));
        sum++;

        // Platform ID
        streamHandler.data(new ByteDataReference(platformID));
        sum += platformID << 8;

        // Reserved (2 bytes)
        streamHandler.data(new EmptyByteArrayDataReference(2));

        // ID string (24 bytes)
        byte[] idStringData = pad(idString, 24);
        streamHandler.data(new ByteArrayDataReference(idStringData));
        sum += stringWordSum(idStringData);

        // Checksum word
        sum += 0xAA55; // Key bytes
        int checksum = 0x10000 - sum;
        streamHandler.data(new LSBFShortDataReference(checksum));

        // Key byte (0x55)
        streamHandler.data(new ByteDataReference(0x55));

        // Key byte (0xAA)
        streamHandler.data(new ByteDataReference(0xAA));
    }
View Full Code Here

    public Fixup doDefaultEntry(boolean bootable, int bootMediaType, int loadSegment, int systemType, int sectorCount)
            throws HandlerException {
        // Boot Indicator
        if (bootable) {
            streamHandler.data(new ByteDataReference(0x88));
        } else {
            streamHandler.data(new ByteDataReference(0));
        }

        // Boot media type
        streamHandler.data(getBootMediaType(bootMediaType));

        // Load Segment: (0: use traditional segment of 0x7C0)
        streamHandler.data(new LSBFShortDataReference(loadSegment));

        // System Type
        streamHandler.data(new ByteDataReference(systemType));

        // Unused byte
        streamHandler.data(new ByteDataReference(0));

        // Sector Count
        streamHandler.data(new LSBFShortDataReference(sectorCount));

        // Load RBA
View Full Code Here

    public void doSectionHeader(boolean moreHeaders, int platformID, int sectionEntriesCount, String idString)
            throws HandlerException {
        // Header Indicator
        if (moreHeaders) {
            streamHandler.data(new ByteDataReference(0x90));
        } else {
            streamHandler.data(new ByteDataReference(0x91));
        }

        // Platform ID
        streamHandler.data(new ByteDataReference(platformID));

        // Number of section entries following this header
        streamHandler.data(new LSBFShortDataReference(sectionEntriesCount));

        // ID string identifying the section
View Full Code Here

    public Fixup doSectionEntry(boolean bootable, int bootMediaType, int loadSegment, int systemType, int sectorCount,
                                boolean entryExtFollows, boolean containsATAPIDriver, boolean containsSCSIDriver,
                                int selectionCriteriaType) throws HandlerException {
        // Boot Indicator
        if (bootable) {
            streamHandler.data(new ByteDataReference(0x88));
        } else {
            streamHandler.data(new ByteDataReference(0));
        }

        // Boot media type
        streamHandler.data(getExtendedBootMediaType(bootMediaType, entryExtFollows, containsATAPIDriver,
                containsSCSIDriver));

        // Load Segment: (0: use traditional segment of 0x7C0)
        streamHandler.data(new LSBFShortDataReference(loadSegment));

        // System Type
        streamHandler.data(new ByteDataReference(systemType));

        // Unused byte
        streamHandler.data(new ByteDataReference(0));

        // Sector Count
        streamHandler.data(new LSBFShortDataReference(sectorCount));

        // Load RBA
        Fixup loadRBA = streamHandler.fixup(new LSBFWordDataReference(0));

        // Selection criteria type
        streamHandler.data(new ByteDataReference(selectionCriteriaType));

        // Vendor unique selection criteria (18 bytes): handle externally
        return loadRBA;
    }
View Full Code Here

        return loadRBA;
    }

    public void doSectionEntryExtension(boolean moreExtRecords) throws HandlerException {
        // Extension Identificator (0x44)
        streamHandler.data(new ByteDataReference(0x44));

        // Whether Extension Records follows or not (final Extension)
        if (moreExtRecords) {
            // Set bit 5
            streamHandler.data(new ByteDataReference(1 << 4));
        } else {
            streamHandler.data(new ByteDataReference(0));
        }

        // Vendor unique selection criteria (30 bytes): handle externally
    }
View Full Code Here

        return sum;
    }

    private DataReference getBootMediaType(int bootMediaType) throws HandlerException {
        if (bootMediaType >= 0 && bootMediaType <= 4) {
            return new ByteDataReference(bootMediaType);
        }
        throw new HandlerException("Invalid Boot Media Type: " + bootMediaType);
    }
View Full Code Here

        if (containsSCSIDriver) {
            // Set bit 7
            bits &= 1 << 6;
        }

        return new ByteDataReference(bits);
    }
View Full Code Here

        svd.setMetadata(config);
        volumeFixups.putAll(svd.doSVD());

        // Set Volume Flags to 0 (Unused Field)
        Fixup volumeFlags = (Fixup) volumeFixups.get("volumeFlagsFixup");
        volumeFlags.data(new ByteDataReference(0));
        volumeFlags.close();
        volumeFixups.remove("volumeFlagsFixup");

        // Set Escape Sequences for UCS-2 level
        Fixup escapeSequences = (Fixup) volumeFixups.get("escapeSequencesFixup");
View Full Code Here

        this.type = type;
        this.helper = helper;
    }

    ByteDataReference getType() {
        return new ByteDataReference(type);
    }
View Full Code Here

TOP

Related Classes of com.github.stephenc.javaisotools.sabre.impl.ByteDataReference

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.