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 SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThis is the Source creation factory interface.
- 
Method SummaryModifier and TypeMethodDescriptionvoiddefault booleanextensionLike(String extension) Test if this name has a given file extension.getName()intgetSize()booleandefault booleanisApproxBetween(int value1, int value2) Indicates if the source image is "approximately" between these two values (less any image over-read).default booleanisApproxEQ(int value) Indicates if the source image is approximately equal to this size (less any image over-read).readBytes(int offset, int length) voidwriteBytes(int offset, DataBuffer data) Methods inherited from interface org.applecommander.capability.CapabilityProvidercanMethods inherited from interface org.applecommander.hint.HintProvideris, isAny
- 
Method Details- 
getSizeint getSize()
- 
getNameString getName()
- 
readAllBytesDataBuffer readAllBytes()
- 
readBytes
- 
writeBytes
- 
hasChangedboolean hasChanged()
- 
clearChangesvoid clearChanges()
- 
informationList<Information> information()
- 
isApproxEQdefault 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 255 extra bytes at the end of a disk image. Must be at least the requested size!
- 
isApproxBetweendefault boolean isApproxBetween(int value1, int value2) Indicates if the source image is "approximately" between these two values (less any image over-read). Currently, hardcoded to allow up to 255 extra bytes at the end of a disk image. Must be at least the requested size!
- 
extensionLikeTest if this name has a given file extension.
 
-