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

Method fromByteArray

guava/src/com/google/common/math/Stats.java:627–635  ·  view source on GitHub ↗

Creates a Stats 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

625 * versions.
626 */
627 public static Stats fromByteArray(byte[] byteArray) {
628 checkNotNull(byteArray);
629 checkArgument(
630 byteArray.length == BYTES,
631 "Expected Stats.BYTES = %s remaining , got %s",
632 BYTES,
633 byteArray.length);
634 return readFrom(ByteBuffer.wrap(byteArray).order(ByteOrder.LITTLE_ENDIAN));
635 }
636
637 /**
638 * Creates a Stats instance from the byte representation read from the given {@link ByteBuffer}.

Calls 5

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