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)
| 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 | } |
no test coverage detected