MCPcopy
hub / github.com/google/guava / fromByteArray

Method fromByteArray

guava/src/com/google/common/math/PairedStats.java:304–316  ·  view source on GitHub ↗

Creates a {@link PairedStats} instance from the given byte representation which was obtained by {@link #toByteArray}. <p><b>Note:</b> No guarantees are made regarding stability of the representation between versions.

(byte[] byteArray)

Source from the content-addressed store, hash-verified

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

Calls 5

readFromMethod · 0.95
orderMethod · 0.65
checkNotNullMethod · 0.45
checkArgumentMethod · 0.45
wrapMethod · 0.45