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

Method readFrom

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

Creates a Stats instance from the byte representation read from the given {@link ByteBuffer}. <p><b>Note:</b> No guarantees are made regarding stability of the representation between versions. @param buffer A {@link ByteBuffer} with at least BYTES {@link ByteBuffer#remaining}, ordered as {@lin

(ByteBuffer buffer)

Source from the content-addressed store, hash-verified

645 * instance is read. In the process increases the position of {@link ByteBuffer} by BYTES.
646 */
647 static Stats readFrom(ByteBuffer buffer) {
648 checkNotNull(buffer);
649 checkArgument(
650 buffer.remaining() >= BYTES,
651 "Expected at least Stats.BYTES = %s remaining , got %s",
652 BYTES,
653 buffer.remaining());
654 return new Stats(
655 buffer.getLong(),
656 buffer.getDouble(),
657 buffer.getDouble(),
658 buffer.getDouble(),
659 buffer.getDouble());
660 }
661
662 private static final long serialVersionUID = 0;
663}

Callers 2

fromByteArrayMethod · 0.95
fromByteArrayMethod · 0.95

Calls 3

checkNotNullMethod · 0.45
checkArgumentMethod · 0.45
remainingMethod · 0.45

Tested by

no test coverage detected