Class ByteArrayContent

    • Field Detail

      • bytes

        public final byte[] bytes
        The underlying byte array.
      • baseName

        public final String baseName
        The basename returned by getName(). May be null.
    • Constructor Detail

      • ByteArrayContent

        public ByteArrayContent​(byte[] bytes,
                                String contentType,
                                String baseName)
        Constructs a file content object based on specified byte array.
        Parameters:
        bytes - the underlying byte array
        contentType - the content type associated to the contents of the byte array. May be null.
        baseName - a basename for the contents of the byte array. May be null.
    • Method Detail

      • getName

        public String getName()
        Description copied from interface: FileContent
        Returns the basename of this file content object. May return null if not applicable.
        Specified by:
        getName in interface FileContent
      • getContentType

        public String getContentType()
        Description copied from interface: FileContent
        Returns the content type of this file content object. May return null if unknown.
        Specified by:
        getContentType in interface FileContent
      • getSize

        public long getSize()
        Description copied from interface: FileContent
        Returns the size in bytes of this file content object.
        Specified by:
        getSize in interface FileContent
      • getInputStream

        public InputStream getInputStream()
        Description copied from interface: FileContent
        Returns an input stream allowing the read the contents of this file content object.
        Specified by:
        getInputStream in interface FileContent