public static class DirectoryBasedClassFileInput.FileBasedClassFile extends java.lang.Object implements ClassFileEntry
| Constructor and Description |
|---|
FileBasedClassFile(java.nio.file.Path relativePath,
java.nio.file.Path path) |
| Modifier and Type | Method and Description |
|---|---|
java.nio.file.Path |
getRelativePath()
Return the relative path from the root of the archive/folder abstraction.
|
long |
getSize()
Returns the entry size in bytes.
|
java.lang.String |
name()
Returns the entry name.
|
byte[] |
readAllBytes()
Read the content into a newly allocated byte[].
|
int |
readAllBytes(byte[] bytes)
Read the content of the file into an existing byte[]
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwithDexExtensionpublic FileBasedClassFile(@NonNull
java.nio.file.Path relativePath,
@NonNull
java.nio.file.Path path)
public java.lang.String name()
ClassFileEntryname in interface ClassFileEntrypublic long getSize()
throws java.io.IOException
ClassFileEntrygetSize in interface ClassFileEntryjava.io.IOExceptionpublic java.nio.file.Path getRelativePath()
ClassFileEntrygetRelativePath in interface ClassFileEntrypublic byte[] readAllBytes()
throws java.io.IOException
ClassFileEntryreadAllBytes in interface ClassFileEntryjava.io.IOException - failed to read the file.public int readAllBytes(byte[] bytes)
throws java.io.IOException
ClassFileEntryreadAllBytes in interface ClassFileEntrybytes - the bytes to read the content of the file into.java.io.IOException - failed to read the file or the buffer was too small.