本文整理汇总了Java中org.h2.mvstore.DataUtils.readVarInt方法的典型用法代码示例。如果您正苦于以下问题:Java DataUtils.readVarInt方法的具体用法?Java DataUtils.readVarInt怎么用?Java DataUtils.readVarInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.h2.mvstore.DataUtils
的用法示例。
在下文中一共展示了DataUtils.readVarInt方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: read
import org.h2.mvstore.DataUtils; //导入方法依赖的package包/类
@Override
public Object read(ByteBuffer buff) {
int flags = DataUtils.readVarInt(buff);
if (flags == -1) {
return null;
}
float[] minMax = new float[dimensions * 2];
for (int i = 0; i < dimensions; i++) {
float min = buff.getFloat();
float max;
if ((flags & (1 << i)) != 0) {
max = min;
} else {
max = buff.getFloat();
}
minMax[i + i] = min;
minMax[i + i + 1] = max;
}
long id = DataUtils.readVarLong(buff);
return new SpatialKey(id, minMax);
}
示例2: read
import org.h2.mvstore.DataUtils; //导入方法依赖的package包/类
@Override
public Object read(ByteBuffer buff, int tag) {
switch (tag) {
case TYPE_INT:
return DataUtils.readVarInt(buff);
case TAG_INTEGER_NEGATIVE:
return -DataUtils.readVarInt(buff);
case TAG_INTEGER_FIXED:
return buff.getInt();
}
return tag - TAG_INTEGER_0_15;
}
示例3: read
import org.h2.mvstore.DataUtils; //导入方法依赖的package包/类
@Override
public Object[] read(ByteBuffer buff) {
int len = DataUtils.readVarInt(buff);
Object[] x = new Object[len];
for (int i = 0; i < len; i++) {
x[i] = types[i].read(buff);
}
return x;
}
示例4: read
import org.h2.mvstore.DataUtils; //导入方法依赖的package包/类
@Override
public AlleleProperties read(ByteBuffer buff) {
int len = DataUtils.readVarInt(buff);
byte[] data = DataUtils.newBytes(len);
buff.get(data);
try {
return AlleleProperties.parseFrom(data);
} catch (InvalidProtocolBufferException e) {
throw new InvalidAlleleProtoException(e);
}
}
示例5: read
import org.h2.mvstore.DataUtils; //导入方法依赖的package包/类
@Override
public AlleleKey read(ByteBuffer buff) {
int len = DataUtils.readVarInt(buff);
byte[] data = DataUtils.newBytes(len);
buff.get(data);
try {
return AlleleKey.parseFrom(data);
} catch (InvalidProtocolBufferException e) {
throw new InvalidAlleleProtoException(e);
}
}
示例6: readVarInt
import org.h2.mvstore.DataUtils; //导入方法依赖的package包/类
private static int readVarInt(ByteBuffer buff) {
return DataUtils.readVarInt(buff);
}
示例7: read
import org.h2.mvstore.DataUtils; //导入方法依赖的package包/类
@Override
public String read(ByteBuffer buff) {
int len = DataUtils.readVarInt(buff);
return DataUtils.readString(buff, len);
}