@Override public Long getRenderFlag() { long ret = Short.toUnsignedLong( this.getFrequency() ); if( this.isActive() && this.isPowered() ) { ret |= 0x10000L; } return ret; } }
@Override protected long decrement(int index) { if(counters[index] == 0) return 0; return Short.toUnsignedLong(--counters[index]); }
@Override public final long longValue() { return Short.toUnsignedLong(value); }
@Override protected long count(int index) { return Short.toUnsignedLong(counters[index]); }
@Override public final long longValue() { return Short.toUnsignedLong(value); }
@Override protected long increment(int index) { if(Short.toUnsignedLong(counters[index]) == MAX) { overflowHandler.run(); return MAX; } return Short.toUnsignedLong(++counters[index]); }
@Override public Map<Integer, Long> getCountMap() { Map<Integer, Long> result = new HashMap<>(); for (int i = 0; i < counters.length; i++) { long count = Short.toUnsignedLong(counters[i]); if (count > 0) { result.put(i, count); } } return result; }
@Override public long longValue(int index) {return Short.toUnsignedLong(super.shortValue(index));} @Override public int intValue(int index) {return Short.toUnsignedInt (super.shortValue(index));}
public long readVarInt(long max) throws IOException { long fb = Byte.toUnsignedLong(readByte()); long value; if (fb == 0xFD) { value = Short.toUnsignedLong(readShort()); } else if (fb == 0xFE) { value = Integer.toUnsignedLong(readInt()); } else if (fb == 0xFF) { value = readLong(); } else { value = fb; } if (Long.compareUnsigned(value, max) > 0) { throw new IOException(ErrorCode.ParamError); } return value; } public long readVarInt2(long max) throws IOException {
public long readVarInt(long max) throws IOException { long fb = Byte.toUnsignedLong(readByte()); long value; if (fb == 0xFD) { value = Short.toUnsignedLong(readShort()); } else if (fb == 0xFE) { value = Integer.toUnsignedLong(readInt()); } else if (fb == 0xFF) { value = readLong(); } else { value = fb; } if (Long.compareUnsigned(value, max) > 0) { throw new IOException(); } return value; }
public long readVarInt(long max) throws IOException { long fb = Byte.toUnsignedLong(readByte()); long value; if (fb == 0xFD) { value = Short.toUnsignedLong(readShort()); } else if (fb == 0xFE) { value = Integer.toUnsignedLong(readInt()); } else if (fb == 0xFF) { value = readLong(); } else { value = fb; } if (Long.compareUnsigned(value, max) > 0) { throw new IOException(ErrorCode.ParamError); } return value; } public long readVarInt2(long max) throws IOException {
public long readVarInt2(long max) throws IOException { long fb = Byte.toUnsignedLong(readByte()); long value; if (fb == ScriptOp.OP_PUSHDATA1.getByte()) { value = Byte.toUnsignedLong(readByte()); } else if (fb == ScriptOp.OP_PUSHDATA2.getByte()) { value = Short.toUnsignedLong(readShort()); } else if (fb == ScriptOp.OP_PUSHDATA4.getByte()) { value = Integer.toUnsignedLong(readInt()); } else{ value = fb; } if (Long.compareUnsigned(value, max) > 0) { throw new IOException(ErrorCode.ParamError); } return value; } public String readVarString() throws IOException {
public long readVarInt2(long max) throws IOException { long fb = Byte.toUnsignedLong(readByte()); long value; if (fb == ScriptOp.OP_PUSHDATA1.getByte()) { value = Byte.toUnsignedLong(readByte()); } else if (fb == ScriptOp.OP_PUSHDATA2.getByte()) { value = Short.toUnsignedLong(readShort()); } else if (fb == ScriptOp.OP_PUSHDATA4.getByte()) { value = Integer.toUnsignedLong(readInt()); } else{ value = fb; } if (Long.compareUnsigned(value, max) > 0) { throw new IOException(ErrorCode.ParamError); } return value; } public String readVarString() throws IOException {