18 lines
403 B
Java
18 lines
403 B
Java
|
package org.capnproto;
|
||
|
|
||
|
import java.nio.ByteBuffer;
|
||
|
|
||
|
final class StructPointer{
|
||
|
public static short dataSize(int structRef) {
|
||
|
return (short)(structRef & 0xffff);
|
||
|
}
|
||
|
|
||
|
public static short ptrCount(int structRef) {
|
||
|
return (short)(structRef >> 16);
|
||
|
}
|
||
|
|
||
|
public static int wordSize(int structRef) {
|
||
|
return (int)dataSize(structRef) + (int)ptrCount(structRef);
|
||
|
}
|
||
|
}
|