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

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


    }

    public Fixup fixup(DataReference myDataReference) throws HandlerException {
        try {
            Fixup fixup =
                    new FileFixup(new RandomAccessFile(myOutputFile, "rw"), position, myDataReference.getLength());
            data(myDataReference);
            return fixup;
        } catch (FileNotFoundException e) {
            throw new HandlerException(e);
        }
View Full Code Here


        this.originalIndexFile = indexFile;
        this.indexFile = new RandomAccessFile(indexFile, "rw");
    }

    public synchronized void addLast(Fixup fixup) {
        FileFixup fileFixup = null;

        if (fixup instanceof FileFixup) {
            fileFixup = (FileFixup) fixup;
            if (this.fixedFile != null) {
                if (this.fixedFile != fileFixup.getFile()) {
                    throw new RuntimeException();
                }
            } else {
                // The first fixup file is used if undefined
                this.fixedFile = fileFixup.getFile();
            }

            try {
                this.indexFile.seek(this.fixupCount * fixupLength);
                this.indexFile.writeLong(fileFixup.getPosition());
                this.indexFile.writeLong(fileFixup.getAvailable());
                this.fixupCount++;
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
View Full Code Here

        try {
            if (index < this.fixupCount) {
                this.indexFile.seek(index * fixupLength);
                position = this.indexFile.readLong();
                available = this.indexFile.readLong();
                result = new FileFixup(this.fixedFile, position, available);
            } else {
                System.out.println("Autsch");
                // throw new IndexOutOfBoundsException();
            }
        } catch (IOException e) {
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

TOP

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

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.