open class ByteArrayResource : AbstractResource
Resource implementation for a given byte array.
Creates a ByteArrayInputStream for the given byte array.
Useful for loading content from any given byte array, without having to resort to a single-use InputStreamResource. Particularly useful for creating mail attachments from local content, where JavaMail needs to be able to read the stream multiple times.
Author
Juergen Hoeller
Author
Sam Brannen
Since
1.2.3
See Also
java.io.ByteArrayInputStreamInputStreamResourceorg.springframework.mail.javamail.MimeMessageHelper#addAttachment(String, InputStreamSource)
ByteArrayResource(byteArray: ByteArray)
Create a new ByteArrayResource(byteArray: ByteArray, description: String)
Create a new |
open fun contentLength(): Long
This implementation returns the length of the underlying byte array. |
|
open fun equals(other: Any?): Boolean
This implementation compares the underlying byte array. |
|
open fun exists(): Boolean
This implementation always returns |
|
fun getByteArray(): ByteArray
Return the underlying byte array. |
|
open fun getDescription(): String
This implementation returns a description that includes the passed-in |
|
open fun getInputStream(): InputStream
This implementation returns a ByteArrayInputStream for the underlying byte array. |
|
open fun hashCode(): Int
This implementation returns the hash code based on the underlying byte array. |
open class TransformedResource : ByteArrayResource
An extension of ByteArrayResource that a ResourceTransformer can use to represent an original resource preserving all other information except the content. |
|
open class TransformedResource : ByteArrayResource
An extension of ByteArrayResource that a ResourceTransformer can use to represent an original resource preserving all other information except the content. |