/** * Returns the value of this {@code UnsignedInteger} as a {@code float}, analogous to a widening * primitive conversion from {@code int} to {@code float}, and correctly rounded. */ @Override public float floatValue() { return longValue(); }
/** * Returns the value of this {@code UnsignedInteger} as a {@code float}, analogous to a widening * primitive conversion from {@code int} to {@code double}, and correctly rounded. */ @Override public double doubleValue() { return longValue(); }
/** Returns the value of this {@code UnsignedInteger} as a {@link BigInteger}. */ public BigInteger bigIntegerValue() { return BigInteger.valueOf(longValue()); }
/** * Returns the value of this {@code UnsignedInteger} as a {@code float}, analogous to a widening * primitive conversion from {@code int} to {@code float}, and correctly rounded. */ @Override public float floatValue() { return longValue(); }
/** * Returns the value of this {@code UnsignedInteger} as a {@code float}, analogous to a widening * primitive conversion from {@code int} to {@code double}, and correctly rounded. */ @Override public double doubleValue() { return longValue(); }
/** * Returns the value of this {@code UnsignedInteger} as a {@code float}, analogous to a widening * primitive conversion from {@code int} to {@code double}, and correctly rounded. */ @Override public double doubleValue() { return longValue(); }
/** * Returns the value of this {@code UnsignedInteger} as a {@code float}, analogous to a widening * primitive conversion from {@code int} to {@code float}, and correctly rounded. */ @Override public float floatValue() { return longValue(); }
/** Returns the value of this {@code UnsignedInteger} as a {@link BigInteger}. */ public BigInteger bigIntegerValue() { return BigInteger.valueOf(longValue()); }
/** Returns the value of this {@code UnsignedInteger} as a {@link BigInteger}. */ public BigInteger bigIntegerValue() { return BigInteger.valueOf(longValue()); }
public SIDTypeNode(BinaryReader binaryReader, ChunkHeader chunkHeader, BxmlNode parent, int length) throws IOException { super(binaryReader, chunkHeader, parent, length); int version = binaryReader.read(); int num_elements = binaryReader.read(); UnsignedInteger id_high = binaryReader.readDWordBE(); int id_low = binaryReader.readWordBE(); StringBuilder builder = new StringBuilder("S-"); builder.append(version); builder.append("-"); builder.append((id_high.longValue() << 16) ^ id_low); for (int i = 0; i < num_elements; i++) { builder.append("-"); builder.append(binaryReader.readDWord()); } value = builder.toString(); }
public void testFromIntBitsLongValue() { for (int value : TEST_INTS) { long expected = value & 0xffffffffL; assertEquals( UnsignedInts.toString(value), expected, UnsignedInteger.fromIntBits(value).longValue()); } }
public void testValueOfBigInteger() { long min = 0; long max = (1L << 32) - 1; for (long value : TEST_LONGS) { boolean expectSuccess = value >= min && value <= max; try { assertEquals(value, UnsignedInteger.valueOf(BigInteger.valueOf(value)).longValue()); assertTrue(expectSuccess); } catch (IllegalArgumentException e) { assertFalse(expectSuccess); } } }
public void testValueOfLong() { long min = 0; long max = (1L << 32) - 1; for (long value : TEST_LONGS) { boolean expectSuccess = value >= min && value <= max; try { assertEquals(value, UnsignedInteger.valueOf(value).longValue()); assertTrue(expectSuccess); } catch (IllegalArgumentException e) { assertFalse(expectSuccess); } } }
checksum = binaryReader.readDWord(); if (crc32.getValue() != checksum.longValue()) { throw new IOException("Invalid checksum");
/** * Returns the value of this {@code UnsignedInteger} as a {@code float}, analogous to a widening * primitive conversion from {@code int} to {@code double}, and correctly rounded. */ @Override public double doubleValue() { return longValue(); }
/** * Returns the value of this {@code UnsignedInteger} as a {@code float}, analogous to a widening * primitive conversion from {@code int} to {@code double}, and correctly rounded. */ @Override public double doubleValue() { return longValue(); }
/** * Returns the value of this {@code UnsignedInteger} as a {@link BigInteger}. */ public BigInteger bigIntegerValue() { return BigInteger.valueOf(longValue()); }
/** * Returns the value of this {@code UnsignedInteger} as a {@link BigInteger}. */ public BigInteger bigIntegerValue() { return BigInteger.valueOf(longValue()); }
@Override public void writeBson(final BsonWriter bsonWriter) { bsonWriter.writeStartArray(); for (final UnsignedInteger unsignedInteger : stack) { bsonWriter.writeInt64(unsignedInteger.longValue()); } bsonWriter.writeEndArray(); } }