Class AppleSingle
- java.lang.Object
-
- io.github.applecommander.applesingle.AppleSingle
-
public class AppleSingle extends java.lang.ObjectSupport reading of data from and AppleSingle source. Does not implement all components at this time, extend as required and/or understood. All construction has been deferred to theread(...)orbuilder()methods.Currently supports entries:
1. Data Fork
2. Resource Fork
3. Real Name
8. File Dates Info
11. ProDOS File Info- See Also:
- AppleCommander issue #20
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAppleSingle.Builder
-
Field Summary
Fields Modifier and Type Field Description static intMAGIC_NUMBERstatic java.lang.StringVERSIONstatic intVERSION_NUMBER1static intVERSION_NUMBER2
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.List<Entry>asEntries(byte[] data)static java.util.List<Entry>asEntries(AppleSingleReader reader)static java.util.List<Entry>asEntries(java.io.File file)static java.util.List<Entry>asEntries(java.io.InputStream inputStream)static java.util.List<Entry>asEntries(java.nio.file.Path path)static AppleSingle.Builderbuilder()byte[]getDataFork()FileDatesInfogetFileDatesInfo()ProdosFileInfogetProdosFileInfo()java.lang.StringgetRealName()byte[]getResourceFork()static AppleSingleread(byte[] data)static AppleSingleread(java.io.File file)static AppleSingleread(java.io.InputStream inputStream)static AppleSingleread(java.nio.file.Path path)voidsave(java.io.File file)Save this AppleSingle to a File.voidsave(java.io.OutputStream outputStream)Write this AppleSingle to the given output stream.voidsave(java.nio.file.Path path)Save this AppleSingle to a Path.static booleantest(byte[] data)Perform a quick test against a byte array to see if it is an AppleSingle file.static booleantest(AppleSingleReader reader)Perform a quick test against a reader to see if it is an AppleSingle file.static booleantest(java.io.File file)Perform a quick test against a File to see if it is an AppleSingle file.static booleantest(java.io.InputStream inputStream)Perform a quick test against an InputStream to see if it is an AppleSingle file.static booleantest(java.nio.file.Path path)Perform a quick test against a Path to see if it is an AppleSingle file.static voidwrite(java.io.OutputStream outputStream, java.util.List<Entry> entries)Common write capability for an AppleSingle based on entries.
-
-
-
Field Detail
-
MAGIC_NUMBER
public static final int MAGIC_NUMBER
- See Also:
- Constant Field Values
-
VERSION_NUMBER1
public static final int VERSION_NUMBER1
- See Also:
- Constant Field Values
-
VERSION_NUMBER2
public static final int VERSION_NUMBER2
- See Also:
- Constant Field Values
-
VERSION
public static final java.lang.String VERSION
-
-
Method Detail
-
getDataFork
public byte[] getDataFork()
-
getResourceFork
public byte[] getResourceFork()
-
getRealName
public java.lang.String getRealName()
-
getProdosFileInfo
public ProdosFileInfo getProdosFileInfo()
-
getFileDatesInfo
public FileDatesInfo getFileDatesInfo()
-
save
public void save(java.io.OutputStream outputStream) throws java.io.IOExceptionWrite this AppleSingle to the given output stream. Note that it only supports the "understood" components.- Throws:
java.io.IOException
-
save
public void save(java.io.File file) throws java.io.IOExceptionSave this AppleSingle to a File.- Throws:
java.io.IOException
-
save
public void save(java.nio.file.Path path) throws java.io.IOExceptionSave this AppleSingle to a Path.- Throws:
java.io.IOException
-
write
public static void write(java.io.OutputStream outputStream, java.util.List<Entry> entries) throws java.io.IOExceptionCommon write capability for an AppleSingle based on entries. Also can be used by external entities to write a properly formatted AppleSingle file without the ProDOS assumptions of AppleSingle.- Throws:
java.io.IOException
-
read
public static AppleSingle read(java.io.InputStream inputStream) throws java.io.IOException
- Throws:
java.io.IOException
-
read
public static AppleSingle read(java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
read
public static AppleSingle read(java.nio.file.Path path) throws java.io.IOException
- Throws:
java.io.IOException
-
read
public static AppleSingle read(byte[] data) throws java.io.IOException
- Throws:
java.io.IOException
-
asEntries
public static java.util.List<Entry> asEntries(java.io.InputStream inputStream) throws java.io.IOException
- Throws:
java.io.IOException
-
asEntries
public static java.util.List<Entry> asEntries(java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
asEntries
public static java.util.List<Entry> asEntries(java.nio.file.Path path) throws java.io.IOException
- Throws:
java.io.IOException
-
asEntries
public static java.util.List<Entry> asEntries(byte[] data) throws java.io.IOException
- Throws:
java.io.IOException
-
asEntries
public static java.util.List<Entry> asEntries(AppleSingleReader reader) throws java.io.IOException
- Throws:
java.io.IOException
-
test
public static boolean test(java.io.File file) throws java.io.IOExceptionPerform a quick test against a File to see if it is an AppleSingle file.- Throws:
java.io.IOException
-
test
public static boolean test(java.nio.file.Path path) throws java.io.IOExceptionPerform a quick test against a Path to see if it is an AppleSingle file.- Throws:
java.io.IOException
-
test
public static boolean test(java.io.InputStream inputStream) throws java.io.IOExceptionPerform a quick test against an InputStream to see if it is an AppleSingle file.- Throws:
java.io.IOException
-
test
public static boolean test(byte[] data)
Perform a quick test against a byte array to see if it is an AppleSingle file.
-
test
public static boolean test(AppleSingleReader reader)
Perform a quick test against a reader to see if it is an AppleSingle file.
-
builder
public static AppleSingle.Builder builder()
-
-