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:
@@ -336,7 +336,7 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe
|
||||
|
||||
private void transformAndMarshal(Object graph, Result result) throws IOException {
|
||||
try {
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream(1024);
|
||||
marshalOutputStream(graph, os);
|
||||
ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
|
||||
Transformer transformer = this.transformerFactory.newTransformer();
|
||||
@@ -424,7 +424,7 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe
|
||||
if (encoding != null) {
|
||||
transformer.setOutputProperty(OutputKeys.ENCODING, encoding);
|
||||
}
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream(1024);
|
||||
transformer.transform(source, new StreamResult(os));
|
||||
ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
|
||||
return unmarshalInputStream(is);
|
||||
|
||||
Reference in New Issue
Block a user