Class Plugin.Engine.Source.Element.ForByteArray

    • Field Detail

      • name

        private final java.lang.String name
        The element's name.
      • binaryRepresentation

        private final byte[] binaryRepresentation
        The element's binary representation.
    • Constructor Detail

      • ForByteArray

        public ForByteArray​(java.lang.String name,
                            byte[] binaryRepresentation)
        Creates an element that is represented by a byte array.
        Parameters:
        name - The element's name.
        binaryRepresentation - The element's binary representation.
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns the element's relative path and name.
        Specified by:
        getName in interface Plugin.Engine.Source.Element
        Returns:
        The element's path and name.
      • getInputStream

        public java.io.InputStream getInputStream()
        Returns an input stream to read this element's binary information.
        Specified by:
        getInputStream in interface Plugin.Engine.Source.Element
        Returns:
        An input stream that represents this element's binary information.
      • resolveAs

        public <T> T resolveAs​(java.lang.Class<T> type)
        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 interface Plugin.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.