Package com.android.builder.dexing
Interface ClassFileEntry
public interface ClassFileEntry
A single .class file abstraction. Relative path matches the package directory structure, and
convenience methods to obtain the content.
-
Method Summary
Modifier and TypeMethodDescriptiongetInput()Return theClassFileInputthat has produced this entryReturn the relative path from the root of the archive/folder abstraction.longgetSize()Returns the entry size in bytes.name()Returns the entry name.byte[]Read the content into a newly allocated byte[].intreadAllBytes(byte[] bytes) Read the content of the file into an existing byte[]static StringwithDexExtension(String classFilePath) Takes the specified .class file, and changes its extension to .dex.
-
Method Details
-
name
String name()Returns the entry name. -
getSize
Returns the entry size in bytes.- Throws:
IOException
-
getRelativePath
String getRelativePath()Return the relative path from the root of the archive/folder abstraction. -
getInput
Return theClassFileInputthat has produced this entry -
readAllBytes
Read the content into a newly allocated byte[].- Returns:
- file content as a byte[]
- Throws:
IOException- failed to read the file.
-
readAllBytes
Read the content of the file into an existing byte[]- Parameters:
bytes- the bytes to read the content of the file into.- Returns:
- the number of bytes read.
- Throws:
IOException- failed to read the file or the buffer was too small.
-
withDexExtension
Takes the specified .class file, and changes its extension to .dex. It fails if invoked with a file name that does not end in .class.
-