Package com.github.stephenc.javaisotools.sabre

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


            e.printStackTrace();
        }
    }

    public Fixup fixup(DataReference reference) throws HandlerException {
        throw new HandlerException("Cannot handle fixup in SAX.");
    }
View Full Code Here


    public Fixup fixup(DataReference reference) throws HandlerException {
        throw new HandlerException("Cannot handle fixup in SAX.");
    }

    public long mark() throws HandlerException {
        throw new HandlerException("Cannot mark position in SAX.");
    }
View Full Code Here

        try {
            element = (Element) this.elements.pop();
            this.contentHandler.endElement(this.namespace, element.toString(), this.prefix + ":" + element.toString());
        } catch (SAXException e) {
            throw new HandlerException(e);
        }
    }
View Full Code Here

    public void endDocument() throws HandlerException {
        try {
            this.contentHandler.endElement(this.namespace, "root", this.prefix + ":root");
        } catch (SAXException e) {
            throw new HandlerException(e);
        }
    }
View Full Code Here

        UDFLayoutInformation myUDFLayoutInformation = null;
        try {
            myUDFLayoutInformation = new UDFLayoutInformation(rootUDFImageBuilderFile, myUDFRevision, blockSize);
        }
        catch (Exception ex) {
            throw new HandlerException(ex);
        }

        StreamHandler myStreamHandler = buildStreamHandlerPipeline(myUDFRevision, outputFilename);

        SabreUDFElementFactory mySabreUDFElementFactory = new SabreUDFElementFactory(myStreamHandler);
View Full Code Here

        int bytesRead = 0;

        // Test if fixup is still open
        if (!closed) {
            if (reference.getLength() > available) {
                throw new HandlerException("Fixup larger than available space.");
            }

            // Write fixup into file
            try {
                // Move to position in file
                randomAccessFile.seek(this.position);

                // Copy data reference to position
                buffer = new byte[1024];
                inputStream = reference.createInputStream();
                while ((bytesRead = inputStream.read(buffer, 0, 1024)) != -1) {
                    randomAccessFile.write(buffer, 0, bytesRead);
                }

                // Handle position and available placeholder bytes
                position += reference.getLength();
                available -= reference.getLength();

                // Close the fixup
                // randomAccessFile.close();
            } catch (FileNotFoundException e) {
                throw new HandlerException(e);
            } catch (IOException e) {
                throw new HandlerException(e);
            }
        }
    }
View Full Code Here

    public void startDocument() throws HandlerException {
        try {
            this.randomAccessFile.setLength(0);
        } catch (IOException e) {
            throw new HandlerException(e);
        }
    }
View Full Code Here

                // System.out.println(" Got " + reference);
                // System.out.println(" => " + inputStream + ", " + inputStream.available());
                // System.out.println(" " + lengthToWrite + " => " + bytesToRead + ", handled " + bytesHandled);
                if (bytesHandled == -1) {
                    // System.out.println("Trying to read again... " + inputStream.read());
                    throw new HandlerException("Cannot read all data from reference.");
                }

                // dataOutputStream.write(buffer, 0, bytesHandled);
                this.randomAccessFile.write(buffer, 0, bytesHandled);
                lengthToWrite -= bytesHandled;
                this.position += bytesHandled;
            }
            // dataOutputStream.flush();
        } catch (IOException e) {
            throw new HandlerException(e);
        } finally {
            try {
                if (inputStream != null) {
                    inputStream.close();
                    inputStream = null;
View Full Code Here

    public void endDocument() throws HandlerException {
        try {
            // this.dataOutputStream.close();
            this.randomAccessFile.close();
        } catch (IOException e) {
            throw new HandlerException(e);
        }

    }
View Full Code Here

                this.elementStack++;
                this.outputStream.writeInt((int) 0);
                this.outputStream.writeInt((int) ((Long) element.getId()).longValue());
            }
        } catch (IOException e) {
            throw new HandlerException(e);
        }

        // Delegate to super class
        super.startElement(element);
    }
View Full Code Here

TOP

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

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.