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

Method fromByteArray

output/java_guava/1.4.19/PairedStats.java:317–329  ·  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

315
316
317 public static PairedStats fromByteArray(byte[] byteArray) {
318 checkNotNull(byteArray);
319 checkArgument(
320 byteArray.length == BYTES,
321 "Expected PairedStats.BYTES = %s, got %s",
322 BYTES,
323 byteArray.length);
324 ByteBuffer buffer = ByteBuffer.wrap(byteArray).order(ByteOrder.LITTLE_ENDIAN);
325 Stats xStats = Stats.readFrom(buffer);
326 Stats yStats = Stats.readFrom(buffer);
327 double sumOfProductsOfDeltas = buffer.getDouble();
328 return new PairedStats(xStats, yStats, sumOfProductsOfDeltas);
329 }
330
331 private static final long serialVersionUID = 0;
332}

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