本文整理匯總了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);
}