Tuweni provides support for manipulating unsigned integers and base Ethereum currencies.
To get started, install the units library.
With Maven:
<dependency>
<groupId>org.apache.tuweni</groupId>
<artifactId>units</artifactId>
<version>2.4.1</version>
</dependency>Or using Gradle:
implementation("org.apache.tuweni:units:2.4.1")The units library revolves mainly around the Uint256, Uint384 and Uint64 interfaces.
This tutorial goes over the main uses of Uint256 - you can apply the same behaviors over to Uint384, Uint64 or Uint32.
It will also touch on Wei and Gas.