HttpMessageConverter that can read and write byte arrays.
By default, this converter supports all media types (*/*), and
writes with a Content-Type of application/octet-stream. This can be
overridden by setting the supportedMediaTypes property.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected Long | getContentLength(byte[]
the type to return the content length for bytes, MediaType contentType)Overrides org. |
| public byte[] | readInternal(Class<? extends byte[]>
the type of object to return clazz, HttpInputMessage the HTTP input message to read from message)Implements abstract org. |
| public boolean | supports(Class<?>
the class to test for support clazz)Implements abstract org. |
| protected boolean | supportsRepeatableWrites(byte[]
the object t bytes)Overrides org. |
| protected void | writeInternal(byte[]
the object to write to the output message bytes, HttpOutputMessage the HTTP output message to write to outputMessage)Implements abstract org. |
| ByteArrayHttpMessageConverter | back to summary |
|---|---|
| public ByteArrayHttpMessageConverter() Create a new instance of the | |
| getContentLength | back to summary |
|---|---|
| protected Long getContentLength(byte[] bytes, MediaType contentType) Overrides org. Doc from org. Returns the content length for the given type. By default, this returns | |
| readInternal | back to summary |
|---|---|
| public byte[] readInternal(Class<? extends byte[]> clazz, HttpInputMessage message) throws IOException Implements abstract org. Doc from org. Abstract template method that reads the actual object. Invoked from
| |
| supports | back to summary |
|---|---|
| public boolean supports(Class<?> clazz) Implements abstract org. Doc from org. Indicates whether the given class is supported by this converter. | |
| supportsRepeatableWrites | back to summary |
|---|---|
| protected boolean supportsRepeatableWrites(byte[] bytes) Overrides org. Doc from org. Indicates whether this message converter can write the given object multiple times. Default implementation returns
| |
| writeInternal | back to summary |
|---|---|
| protected void writeInternal(byte[] bytes, HttpOutputMessage outputMessage) throws IOException Implements abstract org. Doc from org. Abstract template method that writes the actual body. Invoked from
| |