本文整理汇总了Java中org.apache.hadoop.hbase.util.PositionedByteRange.get方法的典型用法代码示例。如果您正苦于以下问题:Java PositionedByteRange.get方法的具体用法?Java PositionedByteRange.get怎么用?Java PositionedByteRange.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hbase.util.PositionedByteRange
的用法示例。
在下文中一共展示了PositionedByteRange.get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decode
import org.apache.hadoop.hbase.util.PositionedByteRange; //导入方法依赖的package包/类
@Override
public T decode(PositionedByteRange src) {
if (src.getRemaining() < length) {
throw new IllegalArgumentException("Not enough buffer remaining. src.offset: "
+ src.getOffset() + " src.length: " + src.getLength() + " src.position: "
+ src.getPosition() + " max length: " + length);
}
// create a copy range limited to length bytes. boo.
PositionedByteRange b = new SimplePositionedMutableByteRange(length);
src.get(b.getBytes());
return base.decode(b);
}
示例2: decode
import org.apache.hadoop.hbase.util.PositionedByteRange; //导入方法依赖的package包/类
@Override
public String decode(PositionedByteRange src) {
if (Order.ASCENDING == this.order) {
// avoid unnecessary array copy for ASC case.
String val =
Bytes.toString(src.getBytes(), src.getOffset() + src.getPosition(), src.getRemaining());
src.setPosition(src.getLength());
return val;
} else {
byte[] b = new byte[src.getRemaining()];
src.get(b);
order.apply(b, 0, b.length);
return Bytes.toString(b);
}
}
示例3: skip
import org.apache.hadoop.hbase.util.PositionedByteRange; //导入方法依赖的package包/类
@Override
public int skip(PositionedByteRange src) {
switch (src.get()) {
case IS_INTEGER:
return 1 + typeA.skip(src);
case IS_STRING:
return 1 + typeB.skip(src);
default:
throw new IllegalArgumentException("Unrecognized encoding format.");
}
}
示例4: decode
import org.apache.hadoop.hbase.util.PositionedByteRange; //导入方法依赖的package包/类
@Override
public Object decode(PositionedByteRange src) {
switch (src.get()) {
case IS_INTEGER:
return typeA.decode(src);
case IS_STRING:
return typeB.decode(src);
default:
throw new IllegalArgumentException("Unrecognized encoding format.");
}
}
示例5: decode
import org.apache.hadoop.hbase.util.PositionedByteRange; //导入方法依赖的package包/类
/**
* Read a {@code byte[]} from the buffer {@code src}.
*/
public byte[] decode(PositionedByteRange src, int length) {
byte[] val = new byte[length];
src.get(val);
return val;
}