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.Sink
Nested 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 TypeMethodDescriptionvoid
close()
Returns the in-memory storage.void
retain
(Plugin.Engine.Source.Element element) Retains the supplied element in its original form.void
store
(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:
write
in interfacePlugin.Engine.Target
- Parameters:
manifest
- The manifest for the target ornull
if 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:
store
in interfacePlugin.Engine.Target.Sink
- Parameters:
binaryRepresentations
- The binary representations to store.
-
retain
Retains the supplied element in its original form.- Specified by:
retain
in interfacePlugin.Engine.Target.Sink
- Parameters:
element
- The element to retain.- Throws:
IOException
- If an I/O error occurs.
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in 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.
-