MCPcopy Create free account
hub / github.com/ReadyTalk/avian / compact

Method compact

classpath/java/nio/ByteBuffer.java:55–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53 }
54
55 public ByteBuffer compact() {
56 int remaining = remaining();
57
58 if (position != 0) {
59 ByteBuffer b = slice();
60 position = 0;
61 put(b);
62 }
63
64 position = remaining;
65 limit(capacity());
66
67 return this;
68 }
69
70 public ByteBuffer put(ByteBuffer src) {
71 if (src.hasArray()) {

Callers

nothing calls this directly

Calls 5

sliceMethod · 0.95
putMethod · 0.95
remainingMethod · 0.45
limitMethod · 0.45
capacityMethod · 0.45

Tested by

no test coverage detected