Package org.applecommander.source
Interface Source
- All Superinterfaces:
CapabilityProvider
,Container
,HintProvider
- All Known Implementing Classes:
DataBufferSource
,DiskCopyImage
,FileEntrySource
,FileSource
,UniversalDiskImage
Source and Factory for an archive or disk in AppleCommander.
Typical usage:
Optional<Source> sourceOpt = Sources.create(Path.of(filename));
if (sourceOpt.isPresent()) {
// do something with sourceOpt.get()
System.out.println(sourceOpt.get().getSize());
}
// Only happens if the initiating object is not understood
throw new RuntimeException("Unable to create image source");
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
This is the Source creation factory interface. -
Method Summary
Modifier and TypeMethodDescriptionvoid
default boolean
extensionLike
(String extension) Test if this name has a given file extension.getName()
int
getSize()
boolean
default boolean
isApproxEQ
(int value) Indicates if the source image is approximately equal to this size (less any image over-read).default boolean
isApproxLE
(int value) Indicates if the source image is approximately less than this size (less any image over-read).readBytes
(int offset, int length) void
writeBytes
(int offset, DataBuffer data) Methods inherited from interface org.applecommander.capability.CapabilityProvider
can
Methods inherited from interface org.applecommander.hint.HintProvider
is, isAny
-
Method Details
-
getSize
int getSize() -
getName
String getName() -
readAllBytes
DataBuffer readAllBytes() -
readBytes
-
writeBytes
-
hasChanged
boolean hasChanged() -
clearChanges
void clearChanges() -
information
List<Information> information() -
isApproxEQ
default boolean isApproxEQ(int value) Indicates if the source image is approximately equal to this size (less any image over-read). Currently, hardcoded to allow up to 10 extra bytes at the end of a disk image. Must be at least the requested size! -
isApproxLE
default boolean isApproxLE(int value) Indicates if the source image is approximately less than this size (less any image over-read). Currently, hardcoded to allow up to 10 extra bytes at the end of a disk image. Must be at least the requested size! -
extensionLike
Test if this name has a given file extension.
-