Package org.jnode.apps.vmware.disk.IOUtils

Examples of org.jnode.apps.vmware.disk.IOUtils.KeyValue


    protected Header readHeader(BufferedReader reader)
        throws IOException, UnsupportedFormatException {
        Header header = new Header();

        LOG.debug("trying to read VERSION");
        KeyValue keyValue = IOUtils.readValue(reader, null, VERSION, false);
        if (!"1".equals(keyValue.getValue())) {
            throw new UnsupportedFormatException("expected version 1 (found:" +
                    keyValue.getValue() + ")");
        }
        header.setVersion(keyValue.getValue());

        keyValue = IOUtils.readValue(reader, keyValue, CID, false);
        header.setContentID(Long.valueOf(keyValue.getValue(), 16));

        keyValue = IOUtils.readValue(reader, keyValue, PARENT_CID, false);
        header.setParentContentID(Long.parseLong(keyValue.getValue(), 16));

        keyValue = IOUtils.readValue(reader, keyValue, CREATE_TYPE, true);
        header.setCreateType(CreateType.valueOf(keyValue.getValue()));

        return header;
    }
View Full Code Here

TOP

Related Classes of org.jnode.apps.vmware.disk.IOUtils.KeyValue

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.