Package net.bytebuddy.build
Class Plugin.Engine.Source.Element.ForByteArray
java.lang.Object
net.bytebuddy.build.Plugin.Engine.Source.Element.ForByteArray
- All Implemented Interfaces:
Plugin.Engine.Source.Element
- Enclosing interface:
Plugin.Engine.Source.Element
@Enhance
public static class Plugin.Engine.Source.Element.ForByteArray
extends Object
implements Plugin.Engine.Source.Element
An element representation for a byte array.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.build.Plugin.Engine.Source.Element
Plugin.Engine.Source.Element.ForByteArray, Plugin.Engine.Source.Element.ForFile, Plugin.Engine.Source.Element.ForJarEntry
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]
The element's binary representation.private final String
The element's name. -
Constructor Summary
ConstructorsConstructorDescriptionForByteArray
(String name, byte[] binaryRepresentation) Creates an element that is represented by a byte array. -
Method Summary
Modifier and TypeMethodDescriptionReturns an input stream to read this element's binary information.getName()
Returns the element's relative path and name.<T> T
Resolves this element to a more specialized form if possible.
-
Field Details
-
name
The element's name. -
binaryRepresentation
private final byte[] binaryRepresentationThe element's binary representation.
-
-
Constructor Details
-
ForByteArray
Creates an element that is represented by a byte array.- Parameters:
name
- The element's name.binaryRepresentation
- The element's binary representation.
-
-
Method Details
-
getName
Returns the element's relative path and name. If the name ends with a/
, it represents a folder.- Specified by:
getName
in interfacePlugin.Engine.Source.Element
- Returns:
- The element's path and name.
-
getInputStream
Returns an input stream to read this element's binary information. Must not be invoked for folders.- Specified by:
getInputStream
in interfacePlugin.Engine.Source.Element
- Returns:
- An input stream that represents this element's binary information.
-
resolveAs
Resolves this element to a more specialized form if possible. Doing so allows for performance optimizations if more specialized formats are available.- Specified by:
resolveAs
in interfacePlugin.Engine.Source.Element
- Type Parameters:
T
- The requested spezialized type.- Parameters:
type
- The requested spezialized type.- Returns:
- The resolved element or
null
if a transformation is impossible.
-