本文整理汇总了Java中water.util.UnsafeUtils.get2方法的典型用法代码示例。如果您正苦于以下问题:Java UnsafeUtils.get2方法的具体用法?Java UnsafeUtils.get2怎么用?Java UnsafeUtils.get2使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类water.util.UnsafeUtils
的用法示例。
在下文中一共展示了UnsafeUtils.get2方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: inflate_impl
import water.util.UnsafeUtils; //导入方法依赖的package包/类
@Override public NewChunk inflate_impl(NewChunk nc) {
nc.set_sparseLen(0);
nc.set_len(0);
final int len = _len;
for( int i=0; i<len; i++ ) {
int res = UnsafeUtils.get2(_mem,(i<<1)+_OFF);
if( res == _NA ) nc.addNA();
else nc.addNum(res,0);
}
return nc;
}
示例2: getIValue
import water.util.UnsafeUtils; //导入方法依赖的package包/类
protected final long getIValue(int off){
switch(_valsz){
case 1: return _mem[off+ _ridsz]&0xFF;
case 2: return UnsafeUtils.get2(_mem, off + _ridsz);
case 4: return UnsafeUtils.get4(_mem, off + _ridsz);
case 8: return UnsafeUtils.get8(_mem, off + _ridsz);
default: throw H2O.fail();
}
}
示例3: guessCompressionMethod
import water.util.UnsafeUtils; //导入方法依赖的package包/类
static Compression guessCompressionMethod(byte [] bits) {
// Look for ZIP magic
if( bits.length > ZipFile.LOCHDR && UnsafeUtils.get4(bits, 0) == ZipFile.LOCSIG )
return Compression.ZIP;
if( bits.length > 2 && (UnsafeUtils.get2(bits,0)&0xffff) == GZIPInputStream.GZIP_MAGIC )
return Compression.GZIP;
return Compression.NONE;
}
示例4: intern
import water.util.UnsafeUtils; //导入方法依赖的package包/类
public static H2ONode intern( byte[] bs, int off ) {
byte[] b = new byte[4];
UnsafeUtils.set4(b, 0, UnsafeUtils.get4(bs, off));
int port = UnsafeUtils.get2(bs,off+4)&0xFFFF;
try { return intern(InetAddress.getByAddress(b),port); }
catch( UnknownHostException e ) { throw Log.throwErr(e); }
}
示例5: getDoubles
import water.util.UnsafeUtils; //导入方法依赖的package包/类
@Override public double [] getDoubles(double [] vals, int from, int to, double NA){
for(int i = from; i < to; i++) {
int x = UnsafeUtils.get2(_mem, 2*i);
vals[i-from] = (x == _NA)?NA:x;
}
return vals;
}
示例6: getIntegers
import water.util.UnsafeUtils; //导入方法依赖的package包/类
@Override
public int [] getIntegers(int [] vals, int from, int to, int NA){
for(int i = from; i < to; i++) {
int x = UnsafeUtils.get2(_mem, 2*i);
vals[i-from] = (x == _NA)?NA:x;
}
return vals;
}
示例7: getVal
import water.util.UnsafeUtils; //导入方法依赖的package包/类
private long getVal(int x){
switch(_val_sz){
case 0: return 1;
case 2: return UnsafeUtils.get2(_mem,x+2);
case 4: return UnsafeUtils.get4(_mem,x+4);
case 8: return UnsafeUtils.get8(_mem,x+4);
default: throw H2O.unimpl();
}
}
示例8: intern
import water.util.UnsafeUtils; //导入方法依赖的package包/类
public static H2ONode intern( byte[] bs, int off ) {
byte[] b = new byte[H2Okey.SIZE_OF_IP]; // the size depends on version of selected IP stack
int port;
// The static constant should be optimized
if (!H2O.IS_IPV6) { // IPv4
UnsafeUtils.set4(b, 0, UnsafeUtils.get4(bs, off));
} else { // IPv6
UnsafeUtils.set8(b, 0, UnsafeUtils.get8(bs, off));
UnsafeUtils.set8(b, 8, UnsafeUtils.get8(bs, off + 8));
}
port = UnsafeUtils.get2(bs,off + H2Okey.SIZE_OF_IP) & 0xFFFF;
try { return intern(InetAddress.getByAddress(b),port); }
catch( UnknownHostException e ) { throw Log.throwErr(e); }
}
示例9: intern
import water.util.UnsafeUtils; //导入方法依赖的package包/类
public static H2ONode intern( byte[] bs, int off ) {
byte[] b = new byte[4];
UnsafeUtils.set4(b, 0, UnsafeUtils.get4(bs, off));
int port = UnsafeUtils.get2(bs,off+4)&0xFFFF;
try { return intern(InetAddress.getByAddress(b),port); }
catch( UnknownHostException e ) { throw Log.errRTExcept(e); }
}
示例10: at8_impl
import water.util.UnsafeUtils; //导入方法依赖的package包/类
@Override protected final long at8_impl( int i ) {
long res = UnsafeUtils.get2(_mem,(i<<1)+_OFF);
if( res == C2Chunk._NA ) throw new IllegalArgumentException("at8_abs but value is missing");
return (long)((res + _bias)*_scale);
}
示例11: atd_impl
import water.util.UnsafeUtils; //导入方法依赖的package包/类
@Override protected final double atd_impl( int i ) {
long res = UnsafeUtils.get2(_mem,(i<<1)+_OFF);
return (res == C2Chunk._NA)?Double.NaN:(res + _bias)*_scale;
}
示例12: at8_impl
import water.util.UnsafeUtils; //导入方法依赖的package包/类
@Override protected final long at8_impl( int i ) {
int res = UnsafeUtils.get2(_mem,(i<<1)+_OFF);
if( res == _NA ) throw new IllegalArgumentException("at8_abs but value is missing");
return res;
}
示例13: atd_impl
import water.util.UnsafeUtils; //导入方法依赖的package包/类
@Override protected final double atd_impl( int i ) {
int res = UnsafeUtils.get2(_mem,(i<<1)+_OFF);
return res == _NA?Double.NaN:res;
}
示例14: getId
import water.util.UnsafeUtils; //导入方法依赖的package包/类
protected final int getId(int off){
return _ridsz == 2
?UnsafeUtils.get2(_mem,off)&0xFFFF
:UnsafeUtils.get4(_mem,off);
}
示例15: processRow
import water.util.UnsafeUtils; //导入方法依赖的package包/类
private final void processRow(int r, ChunkVisitor v){
int i = UnsafeUtils.get2(_mem,(r<<1)+_OFF);
if(i == _NA) v.addNAs(1);
else v.addValue(i);
}