Package net.bytebuddy.build
Class Plugin.Engine.Target.InMemory
- java.lang.Object
-
- net.bytebuddy.build.Plugin.Engine.Target.InMemory
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Plugin.Engine.Target,Plugin.Engine.Target.Sink
- Enclosing interface:
- Plugin.Engine.Target
@Enhance public static class Plugin.Engine.Target.InMemory extends java.lang.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 Modifier and Type Field Description private java.util.Map<java.lang.String,byte[]>storageThe map for storing all elements being received.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()java.util.Map<java.lang.String,byte[]>getStorage()Returns the in-memory storage.voidretain(Plugin.Engine.Source.Element element)Retains the supplied element in its original form.voidstore(java.util.Map<TypeDescription,byte[]> binaryRepresentations)Stores the supplied binary representation of types in this sink.java.util.Map<java.lang.String,byte[]>toTypeMap()Returns the in-memory storage as a type-map where all non-class files are discarded.Plugin.Engine.Target.Sinkwrite(java.util.jar.Manifest manifest)Initializes this target prior to writing.
-
-
-
Method Detail
-
write
public Plugin.Engine.Target.Sink write(java.util.jar.Manifest manifest) throws java.io.IOException
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:
java.io.IOException- If an I/O error occurs.
-
store
public void store(java.util.Map<TypeDescription,byte[]> binaryRepresentations)
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
public void retain(Plugin.Engine.Source.Element element) throws java.io.IOException
Retains the supplied element in its original form.- Specified by:
retainin interfacePlugin.Engine.Target.Sink- Parameters:
element- The element to retain.- Throws:
java.io.IOException- If an I/O error occurs.
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
getStorage
public java.util.Map<java.lang.String,byte[]> getStorage()
Returns the in-memory storage.- Returns:
- The in-memory storage.
-
toTypeMap
public java.util.Map<java.lang.String,byte[]> 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.
-
-