Package net.bytebuddy.build
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 net.bytebuddy.build.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 net.bytebuddy.build.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.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
The map for storing all elements being received.
-
-
Constructor Details
-
InMemory
public InMemory()Creates a new in-memory storage. -
InMemory
Creates a new in-memory storage.- Parameters:
storage- The map for storing all elements being received.
-
-
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.
-
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
Returns the in-memory storage.- Returns:
- The in-memory storage.
-
toTypeMap
Returns the in-memory storage as a type-map where all non-class files are discarded.- Returns:
- The in-memory storage as a type map.
-