2016-02-25 09:23:08 +00:00
|
|
|
package com.bytezone.diskbrowser.pascal;
|
|
|
|
|
|
|
|
import com.bytezone.diskbrowser.applefile.AbstractFile;
|
|
|
|
import com.bytezone.diskbrowser.applefile.DefaultAppleFile;
|
|
|
|
import com.bytezone.diskbrowser.utilities.HexFormatter;
|
|
|
|
|
|
|
|
class VolumeEntry extends CatalogEntry
|
|
|
|
{
|
2016-02-29 01:54:44 +00:00
|
|
|
final int totalFiles;
|
|
|
|
final int totalBlocks;
|
2016-02-25 09:23:08 +00:00
|
|
|
|
|
|
|
public VolumeEntry (PascalDisk parent, byte[] buffer)
|
|
|
|
{
|
|
|
|
super (parent, buffer);
|
|
|
|
|
2016-08-02 10:37:27 +00:00
|
|
|
totalBlocks = HexFormatter.intValue (buffer[14], buffer[15]); // 280
|
2016-02-25 09:23:08 +00:00
|
|
|
totalFiles = HexFormatter.intValue (buffer[16], buffer[17]);
|
2016-08-02 10:37:27 +00:00
|
|
|
date = HexFormatter.getPascalDate (buffer, 20); // 2 bytes
|
2016-02-25 09:23:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public AbstractFile getDataSource ()
|
|
|
|
{
|
|
|
|
if (file != null)
|
|
|
|
return file;
|
|
|
|
|
|
|
|
byte[] buffer = parent.getDisk ().readSectors (blocks);
|
|
|
|
file = new DefaultAppleFile (name, buffer);
|
|
|
|
|
|
|
|
return file;
|
|
|
|
}
|
|
|
|
}
|