List of utility methods to do BigInteger Calculate
String | getInterfaceName(final BigInteger datapathid, final String portName, final Integer vlanId) get Interface Name return String.format("%s:%s:%s", datapathid, portName, vlanId); |
String | getIpAddressByBigInteger(BigInteger[] bigs) get Ip Address By Big Integer if (bigs.length != 4 && bigs.length != 16) { throw new IllegalArgumentException(); byte[] bytes = new byte[bigs.length]; for (int i = 0; i < bigs.length; i++) { bytes[i] = (byte) (bigs[i].byteValue() & 0xff); return getIpAddressByHexaBytes(bytes); ... |
String | getIpv4AddrFromNumber(BigInteger addr) get Ipv Addr From Number String[] field = new String[4]; BigInteger unit = BigInteger.valueOf(0x100L); BigInteger number = addr; for (int i = field.length - 1; i >= 0; i--) { BigInteger[] div = number.divideAndRemainder(unit); number = div[0]; field[i] = div[1].toString(10); StringBuilder builder = new StringBuilder(field[0]); for (int i = 1; i < field.length; i++) { builder.append("."); builder.append(field[i]); return builder.toString(); |
String | getIpv6AddrFromNumber(BigInteger addr) get Ipv Addr From Number String[] field = new String[8]; BigInteger unit = BigInteger.valueOf(0x10000L); BigInteger number = addr; for (int i = field.length - 1; i >= 0; i--) { BigInteger[] div = number.divideAndRemainder(unit); number = div[0]; field[i] = div[1].toString(16); StringBuilder builder = new StringBuilder(); constructDecompressed(builder, field); return builder.toString(); |
void | getJsonFromBigIntArray(JsonGenerator jg, BigInteger[] array, String pf) get Json From Big Int Array jg.writeStartArray();
for (BigInteger obj : array) {
jg.writeNumber(obj);
jg.writeEndArray();
|
byte[] | getKeyFromBigInteger(final BigInteger value, final int numBytes) get Key From Big Integer final byte[] valueBytes = value.toByteArray(); final byte[] bytes = new byte[numBytes]; System.arraycopy(valueBytes, 0, bytes, 0, Math.min(valueBytes.length, bytes.length)); return bytes; |
String | getKnownDynamicmacFlowRef(short tableId, BigInteger dpId, long lporTag, String macAddress, long elanTag) get Known Dynamicmac Flow Ref return new StringBuffer().append(tableId).append(elanTag).append(dpId).append(lporTag).append(macAddress) .toString(); |
BigInteger | getLongAsUnsignedBigInteger(long number) get Long As Unsigned Big Integer if (number >= 0) return BigInteger.valueOf(number); return BigInteger.valueOf(number).add(B64); |
byte[] | getMagnitude(BigInteger bi) get Magnitude byte[] b = bi.toByteArray(); if ((b.length > 1) && (b[0] == 0)) { int n = b.length - 1; byte[] newarray = new byte[n]; System.arraycopy(b, 1, newarray, 0, n); b = newarray; return b; ... |
BigInteger | getMetaDataForLPortDispatcher(int lportTag, short serviceIndex, BigInteger serviceMetaData) get Meta Data For L Port Dispatcher return getServiceIndexMetaData(serviceIndex).or(getLportTagMetaData(lportTag)).or(serviceMetaData);
|