@HashCodeAndEqualsPlugin.Enhance public static class Plugin.Engine.Target.InMemory extends Object implements Plugin.Engine.Target, Plugin.Engine.Target.Sink
Plugin.Engine.Target.Discarding, Plugin.Engine.Target.ForFolder, Plugin.Engine.Target.ForJarFile, Plugin.Engine.Target.InMemory, Plugin.Engine.Target.Sink
Plugin.Engine.Target.Sink.ForJarOutputStream
Constructor and Description |
---|
InMemory()
Creates a new in-memory storage.
|
InMemory(Map<String,byte[]> storage)
Creates a new in-memory storage.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
Map<String,byte[]> |
getStorage()
Returns the in-memory storage.
|
void |
retain(Plugin.Engine.Source.Element element)
Retains the supplied element in its original form.
|
void |
store(ClassFileVersion classFileVersion,
Map<TypeDescription,byte[]> binaryRepresentations)
Stores the supplied binary representation of types in this sink.
|
void |
store(Map<TypeDescription,byte[]> binaryRepresentations)
Stores the supplied binary representation of types in this sink.
|
Map<String,byte[]> |
toTypeMap()
Returns the in-memory storage as a type-map where all non-class files are discarded.
|
Map<String,byte[]> |
toTypeMap(ClassFileVersion classFileVersion)
Returns the in-memory storage as a type-map where all non-class files are discarded.
|
Plugin.Engine.Target.Sink |
write(Manifest manifest)
Initializes this target prior to writing.
|
public Plugin.Engine.Target.Sink write(@MaybeNull Manifest manifest) throws IOException
write
in interface Plugin.Engine.Target
manifest
- The manifest for the target or null
if no manifest was found.IOException
- If an I/O error occurs.public void store(Map<TypeDescription,byte[]> binaryRepresentations)
store
in interface Plugin.Engine.Target.Sink
binaryRepresentations
- The binary representations to store.public void store(ClassFileVersion classFileVersion, Map<TypeDescription,byte[]> binaryRepresentations) throws IOException
store
in interface Plugin.Engine.Target.Sink
classFileVersion
- The version of the multi-release jar file, which should at least be 8
as previous
versions are not recognized by regular class loaders.binaryRepresentations
- The binary representations to store.IOException
- If an I/O error occurs.public void retain(Plugin.Engine.Source.Element element) throws IOException
retain
in interface Plugin.Engine.Target.Sink
element
- The element to retain.IOException
- If an I/O error occurs.public void close()
close
in interface Closeable
close
in interface AutoCloseable
public Map<String,byte[]> getStorage()
public Map<String,byte[]> toTypeMap()
public Map<String,byte[]> toTypeMap(ClassFileVersion classFileVersion)
classFileVersion
- The class file version to consider when encountering multi-release class files.Copyright © 2014–2025. All rights reserved.