java.lang.Object | |
↳ | org.springframework.http.converter.BufferedImageHttpMessageConverter |
Implementation of HttpMessageConverter
that can read and write BufferedImage BufferedImages.
By default, this converter can read all media types that are supported by the registered image readers
, and writes using the media type of the first available
registered image writer
. This behavior can be overriden by
setting the #setContentType(org.springframework.http.MediaType) contentType} properties.
If the cacheDir
property is set to an existing directory, this converter will
cache image data.
The process(ImageReadParam)
and process(ImageWriteParam)
template methods allow subclasses to
override Image I/O parameters.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Indicates whether the given class can be read by this converter.
| |||||||||||
Indicates whether the given class can be written by this converter.
| |||||||||||
Returns the default
Content-Type to be used for writing. | |||||||||||
Return the list of
MediaType objects supported by this converter. | |||||||||||
Sets the cache directory.
| |||||||||||
Sets the default
Content-Type to be used for writing. | |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Template method that allows for manipulating the ImageWriteParam before it is used to write an image.
| |||||||||||
Template method that allows for manipulating the ImageReadParam before it is used to read an image.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.http.converter.HttpMessageConverter
|
Indicates whether the given class can be read by this converter.
clazz | the class to test for readability |
---|---|
mediaType | the media type to read, can be null if not specified.
Typically the value of a Content-Type header. |
true
if readable; false
otherwise
Indicates whether the given class can be written by this converter.
clazz | the class to test for writability |
---|---|
mediaType | the media type to write, can be null if not specified.
Typically the value of an Accept header. |
true
if writable; false
otherwise
Returns the default Content-Type
to be used for writing.
Called when write(T, MediaType, HttpOutputMessage)
is invoked without a specified content type parameter.
Return the list of MediaType
objects supported by this converter.
Sets the cache directory. If this property is set to an existing directory, this converter will cache image data.
Sets the default Content-Type
to be used for writing.
IllegalArgumentException | if the given content type is not supported by the Java Image I/O API |
---|
Template method that allows for manipulating the ImageWriteParam before it is used to write an image.
Default implementation is empty.
Template method that allows for manipulating the ImageReadParam before it is used to read an image.
Default implementation is empty.