Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
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); }
It is not necessary to call os.toByteArray().length as it will result in duplicate copy of the byte array.
Attachments
Issue Links
- is related to
-
APEXCORE-502 Unnecessary byte array copy in DefaultKryoStreamCodec.toByteArray
- Closed
- links to