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

38 lines
1.4 KiB
Java
Raw 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.HexFormatter;
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);
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
}
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;
}
}