Package org.jnode.fs.ntfs.attribute

Examples of org.jnode.fs.ntfs.attribute.NTFSResidentAttribute


        if (attr.isResident()) {
            if (dataAttrs.next() != null) {
                throw new IOException("Resident attribute should be by itself, file record = " + this);
            }

            final NTFSResidentAttribute resData = (NTFSResidentAttribute) attr;
            final int attrLength = resData.getAttributeLength();
            if (attrLength < len) {
                throw new IOException("File data(" + attrLength + "b) is not large enough to read:" + len + "b");
            }
            resData.getData(resData.getAttributeOffset() + (int) fileOffset, dest, off, len);

            if (log.isDebugEnabled()) {
                log.debug("readData: read from resident data");
            }
View Full Code Here


        }

        NTFSAttribute attribute = entry.getFileRecord().findAttributeByType(NTFSAttribute.Types.VOLUME_NAME);

        if (attribute instanceof NTFSResidentAttribute) {
            NTFSResidentAttribute residentAttribute = (NTFSResidentAttribute) attribute;
            byte[] nameBuffer = new byte[residentAttribute.getAttributeLength()];

            residentAttribute.getData(residentAttribute.getAttributeOffset(), nameBuffer, 0, nameBuffer.length);

            try {
                // XXX: For Java 6, should use the version that accepts a Charset.
                return new String(nameBuffer, "UTF-16LE");
            } catch (UnsupportedEncodingException e) {
View Full Code Here

TOP

Related Classes of org.jnode.fs.ntfs.attribute.NTFSResidentAttribute

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.