Creates a Stats instance from the byte representation read from the given ByteBuffer. Note: No guarantees are made regarding stability of the representation between versions. @param buffer A ByteBuffer with at least BYTES ByteBuffer#remaining, ordered as {@lin
(ByteBuffer buffer)
| 567 | * instance is read. In the process increases the position of {@link ByteBuffer} by BYTES. |
| 568 | */ |
| 569 | static Stats readFrom(ByteBuffer buffer) { |
| 570 | checkNotNull(buffer); |
| 571 | checkArgument( |
| 572 | buffer.remaining() >= BYTES, |
| 573 | "Expected at least Stats.BYTES = %s remaining , got %s", |
| 574 | BYTES, |
| 575 | buffer.remaining()); |
| 576 | return new Stats( |
| 577 | buffer.getLong(), |
| 578 | buffer.getDouble(), |
| 579 | buffer.getDouble(), |
| 580 | buffer.getDouble(), |
| 581 | buffer.getDouble()); |
| 582 | } |
| 583 | |
| 584 | private static final long serialVersionUID = 0; |
| 585 | } |
no test coverage detected