Revised ResizableByteArrayOutputStream as an actual subclass of ByteArrayOutputStream, and consistently applied appropriate ByteArrayOutputStream initial capacities across the codebase
Issue: SPR-11594
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -218,7 +218,7 @@ public class MappingJackson2MessageConverter implements MessageConverter, BeanCl
|
||||
protected BytesMessage mapToBytesMessage(Object object, Session session, ObjectMapper objectMapper)
|
||||
throws JMSException, IOException {
|
||||
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream(1024);
|
||||
OutputStreamWriter writer = new OutputStreamWriter(bos, this.encoding);
|
||||
objectMapper.writeValue(writer, object);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -221,7 +221,7 @@ public class MappingJacksonMessageConverter implements MessageConverter, BeanCla
|
||||
protected BytesMessage mapToBytesMessage(Object object, Session session, ObjectMapper objectMapper)
|
||||
throws JMSException, IOException {
|
||||
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream(1024);
|
||||
OutputStreamWriter writer = new OutputStreamWriter(bos, this.encoding);
|
||||
objectMapper.writeValue(writer, object);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -231,7 +231,7 @@ public class MarshallingMessageConverter implements MessageConverter, Initializi
|
||||
protected BytesMessage marshalToBytesMessage(Object object, Session session, Marshaller marshaller)
|
||||
throws JMSException, IOException, XmlMappingException {
|
||||
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream(1024);
|
||||
StreamResult streamResult = new StreamResult(bos);
|
||||
marshaller.marshal(object, streamResult);
|
||||
BytesMessage message = session.createBytesMessage();
|
||||
|
||||
Reference in New Issue
Block a user