myExtendedFileEntry.LogicalBlocksRecorded = (long) (directoryFileDataLength / blockSize);
if (directoryFileDataLength % blockSize != 0) {
myExtendedFileEntry.LogicalBlocksRecorded++;
}
Short_ad allocationDescriptor = new Short_ad();
allocationDescriptor.ExtentLength = directoryFileDataLength;
allocationDescriptor.ExtentPosition = dataLocation;
if (directoryFileDataLength % blockSize != 0) {
directoryFileDataLength += blockSize - (directoryFileDataLength % blockSize);
}
byte[] data = new byte[directoryFileDataLength];
long currentRealPosition = dataLocation * blockSize;
int pos = 0;
for (int i = 0; i < childFileIdentifierDescriptors.size(); ++i) {
long tagLocationBlock = (long) (currentRealPosition / blockSize);
FileIdentifierDescriptor childFileIdentifierDescriptor = childFileIdentifierDescriptors.get(i);
childFileIdentifierDescriptor.DescriptorTag.TagLocation = tagLocationBlock;
byte childFileIdentifierDescriptorBytes[] = childFileIdentifierDescriptors.get(i).getBytes();
System.arraycopy(childFileIdentifierDescriptorBytes, 0, data, pos,
childFileIdentifierDescriptorBytes.length);
pos += childFileIdentifierDescriptorBytes.length;
currentRealPosition += childFileIdentifierDescriptorBytes.length;
}
myExtendedFileEntry.AllocationDescriptors = allocationDescriptor.getBytes();
myExtendedFileEntry.LengthofAllocationDescriptors = myExtendedFileEntry.AllocationDescriptors.length;
/*
// full element with descriptor tag
super.data( new ByteArrayDataReference( myExtendedFileEntry.getBytes( blockSize ) ) );