Class FileLoader
java.lang.Object
net.emustudio.emulib.io.FileLoader
Synchronous loader of memory images (BIN, Intel HEX) and tapes (TAP, TZX).
A file is split into immutable FileLoader.Blocks which are passed to a FileLoader.Listener in playback order:
TZX jumps, loops and call sequences are followed (the control blocks themselves are passed too).
Loading is cancelled by interrupting the loading thread; it then throws InterruptedIOException.
For tape playback, use TapeListener which decodes tape blocks into signal callbacks.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classImmutable block of a file.static enumSupported file formats and their extensions.static interfaceReceives blocks synchronously, on the loading thread.static final classZX Spectrum tape header (the 17 bytes after flag 0). -
Method Summary
Modifier and TypeMethodDescriptionstatic voidload(Path path, FileLoader.Format format, FileLoader.Listener listener) Loads a file and passes its blocks to the listener.
-
Method Details
-
load
public static void load(Path path, FileLoader.Format format, FileLoader.Listener listener) throws IOException Loads a file and passes its blocks to the listener.- BIN: one unaddressed block with the whole file
- HEX: one addressed block per contiguous address range
- TAP: one block (ID 0x10) per tape block
- TZX: one block per TZX block, in playback order
- Parameters:
path- file to loadformat- file formatlistener- receiver of blocks- Throws:
IOException- if the file cannot be read or is malformed, or the listener fails;InterruptedIOExceptionif the thread was interrupted
-