dmolony-DiskBrowser/src/com/bytezone/diskbrowser/pascal/VolumeEntry.java

38 lines
1.3 KiB
Java
Raw Permalink Normal View History

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.Utility;
2016-02-25 09:23:08 +00:00
2020-02-09 13:13:33 +00:00
// -----------------------------------------------------------------------------------//
2016-02-25 09:23:08 +00:00
class VolumeEntry extends CatalogEntry
2020-02-09 13:13:33 +00:00
// -----------------------------------------------------------------------------------//
2016-02-25 09:23:08 +00:00
{
2016-02-29 01:54:44 +00:00
final int totalFiles;
final int totalBlocks;
2016-02-25 09:23:08 +00:00
2020-02-09 13:13:33 +00:00
// ---------------------------------------------------------------------------------//
VolumeEntry (PascalDisk parent, byte[] buffer)
// ---------------------------------------------------------------------------------//
2016-02-25 09:23:08 +00:00
{
super (parent, buffer);
2022-05-11 00:09:27 +00:00
totalBlocks = Utility.getShort (buffer, 14); // 280
totalFiles = Utility.getShort (buffer, 16);
2022-05-11 00:09:27 +00:00
localDate = Utility.getPascalLocalDate (buffer, 20); // 2 bytes
2016-02-25 09:23:08 +00:00
}
2020-02-09 13:13:33 +00:00
// ---------------------------------------------------------------------------------//
2016-02-25 09:23:08 +00:00
@Override
public AbstractFile getDataSource ()
2020-02-09 13:13:33 +00:00
// ---------------------------------------------------------------------------------//
2016-02-25 09:23:08 +00:00
{
if (file != null)
return file;
2020-04-10 23:47:52 +00:00
byte[] buffer = parent.getDisk ().readBlocks (blocks);
2016-02-25 09:23:08 +00:00
file = new DefaultAppleFile (name, buffer);
return file;
}
}