Class Plugin.Engine.Target.InMemory

    • Field Detail

      • storage

        private final java.util.Map<java.lang.String,​byte[]> storage
        The map for storing all elements being received.
    • Constructor Detail

      • InMemory

        public InMemory()
        Creates a new in-memory storage.
      • InMemory

        public InMemory​(java.util.Map<java.lang.String,​byte[]> storage)
        Creates a new in-memory storage.
        Parameters:
        storage - The map for storing all elements being received.
    • 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:
        write in interface Plugin.Engine.Target
        Parameters:
        manifest - The manifest for the target or null if 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:
        store in interface Plugin.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:
        retain in interface Plugin.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:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.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.