MCPcopy Create free account
hub / github.com/antlr/codebuff / fromByteArray

Method fromByteArray

corpus/java/training/guava/math/PairedStats.java:308–320  ·  view source on GitHub ↗

Creates a PairedStats instance from the given byte representation which was obtained by #toByteArray. Note: No guarantees are made regarding stability of the representation between versions.

(byte[] byteArray)

Source from the content-addressed store, hash-verified

306 * versions.
307 */
308 public static PairedStats fromByteArray(byte[] byteArray) {
309 checkNotNull(byteArray);
310 checkArgument(
311 byteArray.length == BYTES,
312 "Expected PairedStats.BYTES = %s, got %s",
313 BYTES,
314 byteArray.length);
315 ByteBuffer buffer = ByteBuffer.wrap(byteArray).order(ByteOrder.LITTLE_ENDIAN);
316 Stats xStats = Stats.readFrom(buffer);
317 Stats yStats = Stats.readFrom(buffer);
318 double sumOfProductsOfDeltas = buffer.getDouble();
319 return new PairedStats(xStats, yStats, sumOfProductsOfDeltas);
320 }
321
322 private static final long serialVersionUID = 0;
323}

Callers

nothing calls this directly

Calls 4

readFromMethod · 0.95
checkNotNullMethod · 0.45
checkArgumentMethod · 0.45
wrapMethod · 0.45

Tested by

no test coverage detected