Class Plugin.Engine.Target.InMemory
java.lang.Object
net.bytebuddy.build.Plugin.Engine.Target.InMemory
- All Implemented Interfaces:
Closeable, AutoCloseable, Plugin.Engine.Target, Plugin.Engine.Target.Sink
- Enclosing interface:
Plugin.Engine.Target
@Enhance
public static class Plugin.Engine.Target.InMemory
extends Object
implements Plugin.Engine.Target, Plugin.Engine.Target.Sink
A sink that stores all elements in a memory map.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Plugin.Engine.Target
Plugin.Engine.Target.Discarding, Plugin.Engine.Target.ForFolder, Plugin.Engine.Target.ForJarFile, Plugin.Engine.Target.InMemory, Plugin.Engine.Target.SinkNested classes/interfaces inherited from interface Plugin.Engine.Target.Sink
Plugin.Engine.Target.Sink.ForJarOutputStream -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Returns the in-memory storage.voidretain(Plugin.Engine.Source.Element element) Retains the supplied element in its original form.voidstore(Map<TypeDescription, byte[]> binaryRepresentations) Stores the supplied binary representation of types in this sink.voidstore(ClassFileVersion classFileVersion, Map<TypeDescription, byte[]> binaryRepresentations) Stores the supplied binary representation of types in this sink.Returns the in-memory storage as a type-map where all non-class files are discarded.toTypeMap(ClassFileVersion classFileVersion) Returns the in-memory storage as a type-map where all non-class files are discarded.Initializes this target prior to writing.
-
Field Details
-
storage
-
-
Constructor Details
-
InMemory
public InMemory()Creates a new in-memory storage. -
InMemory
-
-
Method Details
-
write
Initializes this target prior to writing.- Specified by:
writein interfacePlugin.Engine.Target- Parameters:
manifest- The manifest for the target ornullif no manifest was found.- Returns:
- The sink to write to.
- Throws:
IOException- If an I/O error occurs.
-
store
Stores the supplied binary representation of types in this sink.- Specified by:
storein interfacePlugin.Engine.Target.Sink- Parameters:
binaryRepresentations- The binary representations to store.
-
store
public void store(ClassFileVersion classFileVersion, Map<TypeDescription, byte[]> binaryRepresentations) throws IOException Stores the supplied binary representation of types in this sink.- Specified by:
storein interfacePlugin.Engine.Target.Sink- Parameters:
classFileVersion- The version of the multi-release jar file, which should at least be8as previous versions are not recognized by regular class loaders.binaryRepresentations- The binary representations to store.- Throws:
IOException- If an I/O error occurs.
-
retain
Retains the supplied element in its original form.- Specified by:
retainin interfacePlugin.Engine.Target.Sink- Parameters:
element- The element to retain.- Throws:
IOException- If an I/O error occurs.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getStorage
-
toTypeMap
-
toTypeMap
Returns the in-memory storage as a type-map where all non-class files are discarded.- Parameters:
classFileVersion- The class file version to consider when encountering multi-release class files.- Returns:
- The in-memory storage as a type map.
-