You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apex.apache.org by "Vlad Rozov (JIRA)" <ji...@apache.org> on 2016/08/09 01:56:20 UTC
[jira] [Created] (APEXMALHAR-2178) Unnecessary byte array copy in
KryoSerializableStreamCodec
Vlad Rozov created APEXMALHAR-2178:
--------------------------------------
Summary: Unnecessary byte array copy in KryoSerializableStreamCodec
Key: APEXMALHAR-2178
URL: https://issues.apache.org/jira/browse/APEXMALHAR-2178
Project: Apache Apex Malhar
Issue Type: Improvement
Reporter: Vlad Rozov
{noformat}
public Slice toByteArray(T info)
{
ByteArrayOutputStream os = new ByteArrayOutputStream();
Output output = new Output(os);
kryo.writeClassAndObject(output, info);
output.flush();
return new Slice(os.toByteArray(), 0, os.toByteArray().length);
}
{noformat}
It is not necessary to call os.toByteArray().length as it will result in duplicate copy of the byte array.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)