java.math.BigInteger.byteValue()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(145)

本文整理了Java中java.math.BigInteger.byteValue()方法的一些代码示例,展示了BigInteger.byteValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BigInteger.byteValue()方法的具体详情如下:
包路径:java.math.BigInteger
类名称:BigInteger
方法名:byteValue

BigInteger.byteValue介绍

暂无

代码示例

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * remove an existing abstractNum
 *
 * @param abstractNumID
 * @return true if abstractNum with abstractNumID exists in NumberingArray,
 * false if abstractNum with abstractNumID not exists
 */
public boolean removeAbstractNum(BigInteger abstractNumID) {
  if (abstractNumID.byteValue() < abstractNums.size()) {
    ctNumbering.removeAbstractNum(abstractNumID.byteValue());
    abstractNums.remove(abstractNumID.byteValue());
    return true;
  }
  return false;
}

代码示例来源:origin: hibernate/hibernate-orm

return (X) Byte.valueOf( value.byteValue() );

代码示例来源:origin: graphql-java/graphql-java

@Override
  public Byte parseLiteral(Object input) {
    if (!(input instanceof IntValue)) {
      throw new CoercingParseLiteralException(
          "Expected AST type 'IntValue' but was '" + typeName(input) + "'."
      );
    }
    BigInteger value = ((IntValue) input).getValue();
    if (value.compareTo(BYTE_MIN) < 0 || value.compareTo(BYTE_MAX) > 0) {
      throw new CoercingParseLiteralException(
          "Expected value to be in the Byte range but it was '" + value.toString() + "'"
      );
    }
    return value.byteValue();
  }
});

代码示例来源:origin: apache/hive

fastBigIntegerValueUnscaled(
     fastSignum, fast0, fast1, fast2);
 return bigInteger.remainder(BIG_INTEGER_UNSIGNED_BYTE_MAX_VALUE).byteValue();
} else {
   fastBigIntegerValueUnscaled(
     fastSignum, result0, result1, result2);
 return bigInteger.remainder(BIG_INTEGER_UNSIGNED_BYTE_MAX_VALUE).byteValue();

代码示例来源:origin: ethereum/ethereumj

private void parse(byte[] bytes) {
  List<RLPElement> wrapper = RLP.unwrapList(bytes);
  byte[] blockBytes = wrapper.get(0).getRLPData();
  byte[] importFailedBytes = wrapper.get(1).getRLPData();
  byte[] receivedAtBytes = wrapper.get(2).getRLPData();
  byte[] newBlockBytes = wrapper.get(3).getRLPData();
  this.block = new Block(blockBytes);
  this.importFailedAt = ByteUtil.byteArrayToLong(importFailedBytes);
  this.receivedAt = ByteUtil.byteArrayToLong(receivedAtBytes);
  byte newBlock = newBlockBytes == null ? 0 : new BigInteger(1, newBlockBytes).byteValue();
  this.newBlock = newBlock == 1;
  this.nodeId = wrapper.get(4).getRLPData();
}

代码示例来源:origin: postgresql/postgresql

PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
return i.byteValue();

代码示例来源:origin: oblac/jodd

@Test
void testIntToBigInteger() {
  int[] array = new int[] {7,3,1};
  Object result = typeConverterManager.convertType(array, BigInteger[].class);
  assertNotNull(result);
  BigInteger[] bigIntegers = (BigInteger[]) result;
  assertEquals(7, bigIntegers[0].byteValue());
  assertEquals(3, bigIntegers[1].byteValue());
  assertEquals(1, bigIntegers[2].byteValue());
}

代码示例来源:origin: org.postgresql/postgresql

PSQLState.NUMERIC_VALUE_OUT_OF_RANGE);
 return i.byteValue();
} catch (NumberFormatException ex) {
 throw new PSQLException(GT.tr("Bad value for type {0} : {1}", "byte", s),

代码示例来源:origin: web3j/web3j

is(RlpString.create(BigInteger.valueOf(0).byteValue())));
is(RlpString.create(BigInteger.valueOf(15).byteValue())));

代码示例来源:origin: youseries/ureport

private HSSFColor buildHSSFColor(HSSFWorkbook wb,String colorStr){
  String[] color=colorStr.split(",");
  HSSFPalette palette=wb.getCustomPalette();
  byte r=BigInteger.valueOf(Integer.valueOf(color[0])).byteValue();
  byte g=BigInteger.valueOf(Integer.valueOf(color[1])).byteValue();
  byte b=BigInteger.valueOf(Integer.valueOf(color[2])).byteValue();
  HSSFColor targetColor=palette.findColor(r,g,b);
  if(targetColor==null){
    palette.setColorAtIndex(HSSFColorPredefined.LAVENDER.getIndex(), r, g,b);
    targetColor=palette.getColor(HSSFColorPredefined.LAVENDER.getIndex());
  }
  return targetColor;
}

代码示例来源:origin: hector-client/hector

@Override
public Object convertCassTypeToObjType(PropertyMappingDefinition md, byte[] value) {
 BigInteger bigInt = new BigInteger(value);
 // determine our target integer type and then go from there on the
 // conversion method
 Class<?> targetClass = md.getPropDesc().getPropertyType();
 if (targetClass.equals(Integer.class) || targetClass.equals(int.class)) {
  return Integer.valueOf(bigInt.intValue());
 } else if (targetClass.equals(Long.class) || targetClass.equals(long.class)) {
  return Long.valueOf(bigInt.longValue());
 } else if (targetClass.equals(Short.class) || targetClass.equals(short.class)) {
  return Short.valueOf(bigInt.shortValue());
 } else if (targetClass.equals(Byte.class) || targetClass.equals(byte.class)) {
  return Byte.valueOf(bigInt.byteValue());
 } else if (targetClass.equals(BigInteger.class)) {
  return bigInt;
 } else {
  throw new HectorObjectMapperException("Column, " + md.getColName()
    + ", cannot be converted using " + getClass().getSimpleName()
    + " because POJO property, " + md.getPropDesc().getName() + ", of type "
    + md.getPropDesc().getPropertyType().getName()
    + " is not an integer type (in a mathematical context)");
 }
}

代码示例来源:origin: i2p/i2p.i2p

public static ECPoint scalarMult(ECPoint p, BigInteger kin, EllipticCurve curve) {
  ECPoint r = ECPoint.POINT_INFINITY;
  BigInteger prime = ((ECFieldFp) curve.getField()).getP();
  BigInteger k = kin.mod(prime);
  int length = k.bitLength();
  byte[] binarray = new byte[length];
  for (int i = 0; i <= length-1; i++) {
    binarray[i] = k.mod(TWO).byteValue();
    k = k.divide(TWO);
  }
  for (int i = length-1; i >= 0; i--) {
    // i should start at length-1 not -2 because the MSB of binarry may not be 1
    r = doublePoint(r, curve);
    if (binarray[i] == 1) 
      r = addPoint(r, p, curve);
  }
  return r;
}

代码示例来源:origin: ethereum/ethereumj

if (logger.isInfoEnabled())
  hint = word1 + "  " + word2.value();
DataWord extendResult = word2.signExtend(k.byteValue());
program.stackPush(extendResult);

代码示例来源:origin: com.github.krukow/clj-ds

public byte byteValue(){
  if(bipart == null)
    return (byte) lpart;
  else
    return bipart.byteValue();
}

代码示例来源:origin: it.tidalwave.bluebill/it-tidalwave-android-org-openrdf-sesame-model

@Override
public byte byteValue()
{
  return value.byteValue();
}

代码示例来源:origin: org.openrdf.sesame/sesame-model

@Override
public byte byteValue()
{
  return value.byteValue();
}

代码示例来源:origin: cping/LGame

public byte[] getBytes() {
  int[] items = this.items;
  byte[] bytes = new byte[this.length];
  for (int i = 0; i < bytes.length; i++) {
    bytes[i] = BigInteger.valueOf(items[i]).byteValue();
  }
  return bytes;
}

代码示例来源:origin: cping/LGame

public byte[] getBytes() {
  long[] items = this.items;
  byte[] bytes = new byte[this.length];
  for (int i = 0; i < bytes.length; i++) {
    bytes[i] = BigInteger.valueOf(items[i]).byteValue();
  }
  return bytes;
}

代码示例来源:origin: DragonetMC/DragonProxy

public void writeVar(BigInteger v) throws IOException {
  v = v.and(UNSIGNED_LONG_MAX_VALUE);
  BigInteger i = BigInteger.valueOf(-128);
  BigInteger BIX7F = BigInteger.valueOf(0x7f);
  BigInteger BIX80 = BigInteger.valueOf(0x80);
  while (!v.and(i).equals(BigInteger.ZERO)) {
    writeByte(v.and(BIX7F).or(BIX80).byteValue());
    v = v.shiftRight(7);
  }
  writeByte(v.byteValue());
}

代码示例来源:origin: es.gob.afirma.jmulticard/jmulticard

/** Obtiene la referencia de la clave.
 * @return Referencia de la clave. */
public byte getKeyReference() {
  return ((CommonKeyAttributes)getClassAttributes()).getReference().getIntegerValue().byteValue();
}

相关文章