Package com.github.stephenc.javaisotools.sabre

Examples of com.github.stephenc.javaisotools.sabre.Fixup


    public HashMap doPVD() throws HandlerException {
        HashMap memory = doStandardVD();

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

        // Set Escape Sequences to all 0 (Unused Field)
        Fixup escapeSequences = (Fixup) memory.get("escapeSequencesFixup");
        escapeSequences.data(new ThreeByteDataReference(0));
        escapeSequences.close();
        memory.remove("escapeSequencesFixup");

        return memory;
    }
View Full Code Here


        // Volume Descriptor Version
        streamHandler.data(getVDVersion());

        // Unused Field / Volume Flags (SVD): 1 byte
        Fixup vf = streamHandler.fixup(new ByteDataReference(0));
        memory.put("volumeFlagsFixup", vf);

        // System Identifier: 32 bytes
        streamHandler.data(getSystemId());

        // Volume Identifier: 32 bytes
        streamHandler.data(getVolumeId());

        // Unused Field: 8 bytes
        streamHandler.data(new EmptyByteArrayDataReference(8));

        // Volume Space Size
        Fixup vss = streamHandler.fixup(new BothWordDataReference(0));
        memory.put("volumeSpaceSizeFixup", vss);

        // Unused Field / Escape Sequences (SVD): 32 bytes
        Fixup es = streamHandler.fixup(new EmptyByteArrayDataReference(32));
        memory.put("escapeSequencesFixup", es);

        // Volume Set Size
        streamHandler.data(getVolumeSetSize());

        // Volume Sequence Number
        streamHandler.data(getVolumeSeqNo());

        // Logical Block Size
        streamHandler.data(getLogicalBlockSize());

        // Path Table Size
        Fixup pts = streamHandler.fixup(new BothWordDataReference(0));
        memory.put("ptSizeFixup", pts);

        // Type L Path Table Location
        Fixup tlpt = streamHandler.fixup(new LSBFWordDataReference(0));
        memory.put("typeLPTLocationFixup", tlpt);
        // Optional Type L Path Table Location: none
        streamHandler.data(new LSBFWordDataReference(0));

        // Type M Path Table Location
        Fixup tmpt = streamHandler.fixup(new WordDataReference(0));
        memory.put("typeMPTLocationFixup", tmpt);
        // Optional Type M Path Table Location: none
        streamHandler.data(new WordDataReference(0));

        // Directory Record for Root Directory: 34 bytes
View Full Code Here

        ISO9660DirectoryRecord rddr =
                new ISO9660DirectoryRecord(streamHandler, ISO9660Constants.FI_ROOT, helper.getRoot(), helper);
        HashMap drMemory = rddr.doDR();

        // Length of Directory Record
        Fixup drLengthFixup = (Fixup) drMemory.get("drLengthFixup");
        int drLength = ((Integer) drMemory.get("drLength")).intValue();
        drLengthFixup.data(new ByteDataReference(drLength));
        drLengthFixup.close();

        // Root Directory Location
        Fixup rootDirLocation = (Fixup) drMemory.get("drLocationFixup");
        memory.put("rootDirLocationFixup", rootDirLocation);

        // Root Directory Length
        Fixup rootDirLength = (Fixup) drMemory.get("drDataLengthFixup");
        memory.put("rootDirLengthFixup", rootDirLength);
    }
View Full Code Here

            }
        }
    }

    public Fixup fixup(DataReference reference) throws HandlerException {
        Fixup fixup = null;
        fixup = new FileFixup(raFile, position, reference.getLength());
        data(reference);
        return fixup;
    }
View Full Code Here

        // Volume Partition Identifier: 32 bytes
        streamHandler.data(getVolumePartitionId());

        // Volume Partition Location
        Fixup location = streamHandler.fixup(new BothWordDataReference(0));
        memory.put("volumePartitionLocationFixup", location);

        // Volume Partition Size
        Fixup size = streamHandler.fixup(new BothWordDataReference(0));
        memory.put("volumePartitionSizeFixup", size);

        // System Use: handle externally

        return memory;
View Full Code Here

    public HashMap doDR() throws HandlerException {
        HashMap memory = new HashMap();
        int length = 0;

        // Length of Directory Record (including System Use Area)
        Fixup drLength = streamHandler.fixup(new ByteDataReference(0));
        memory.put("drLengthFixup", drLength);
        length += 1;

        // Extended Attribute Record Length
        Fixup extAttrRecordLengthFixup = streamHandler.fixup(new ByteDataReference(0));
        memory.put("drExtAttrRecordLengthFixup", extAttrRecordLengthFixup);
        length += 1;

        // Location of Extent
        Fixup locationFixup = streamHandler.fixup(new BothWordDataReference(0));
        memory.put("drLocationFixup", locationFixup);
        length += 8;

        // Data Length
        Fixup dataLengthFixup = streamHandler.fixup(new BothWordDataReference(0));
        memory.put("drDataLengthFixup", dataLengthFixup);
        length += 8;

        // Recording Date and Time
        Date now = new Date();
View Full Code Here

            HashMap ceMemory = rripFactory.doCEEntry();
            volumeFixups.put("rripERLocationFixup", ceMemory.get("ceLocationFixup"));
            volumeFixups.put("rripERLengthFixup", ceMemory.get("ceLengthFixup"));

            // Write and close ER Offset Fixup
            Fixup rripEROffsetFixup = (Fixup) ceMemory.get("ceOffsetFixup");
            rripEROffsetFixup.data(new BothWordDataReference(0));
            rripEROffsetFixup.close();
        }

        // Update Directory Record Length
        return finalizeDR(memory, helper.getDifferenceTo(position));
    }
View Full Code Here

        Iterator it = fixups.keySet().iterator();
        while (it.hasNext()) {
            ISO9660Directory dir = (ISO9660Directory) it.next();

            // Write and close Location Fixup
            Fixup locationFixup = (Fixup) fixups.get(dir);
            int location = ((Integer) locations.get(dir)).intValue();
            locationFixup.data(new BothWordDataReference(location));
            locationFixup.close();
        }
    }
View Full Code Here

        long position = streamHandler.mark();
        streamHandler.startElement(new LogicalSectorElement("CA"));
        int location = helper.getCurrentLocation();

        // Write and close RRIP ER Location Fixup
        Fixup rripERLocationFixup = (Fixup) volumeFixups.get("rripERLocationFixup");
        rripERLocationFixup.data(new BothWordDataReference(location));
        rripERLocationFixup.close();

        // Write ER Entry
        rripFactory.doEREntry();

        // Write ST Entry and compute length
        int erLength = doST(helper.getDifferenceTo(position));

        // Write and close RRIP ER Length Fixup
        Fixup rripERLengthFixup = (Fixup) volumeFixups.get("rripERLengthFixup");
        rripERLengthFixup.data(new BothWordDataReference(erLength));
        rripERLengthFixup.close();

        // Process unfinished NM Entries
        int offset = erLength;
        Iterator it = unfinishedNMEntries.iterator();
        while (it.hasNext()) {
View Full Code Here

        if (type.equals(ISO9660Constants.TYPE_L_PT)) {
            location_dr = new LSBFWordDataReference(0);
        } else if (type.equals(ISO9660Constants.TYPE_M_PT)) {
            location_dr = new WordDataReference(0);
        }
        Fixup locationFixup = streamHandler.fixup(location_dr);

        // Parent Directory Number
        DataReference parent_dn = null;
        if (type.equals(ISO9660Constants.TYPE_L_PT)) {
            parent_dn = new LSBFShortDataReference(parent);
View Full Code Here

TOP

Related Classes of com.github.stephenc.javaisotools.sabre.Fixup

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.