Something like this?
int x = -1;
long y = x & 0x00000000ffffffffL;
Or am I missing something?
public static long getUnsignedInt(int x) {
return x & 0x00000000ffffffffL;
}
More Related Contents:
- Can we make unsigned byte in Java
- Why doesn’t Java support unsigned ints?
- Declaring an unsigned int in Java
- Java equivalent of unsigned long long?
- Unsigned short in Java
- How to use the unsigned Integer in Java 8 and Java 9?
- What is the best way to work around the fact that ALL Java bytes are signed?
- What is the recommended way to escape HTML symbols in plain Java?
- Finding the max/min value in an array of primitives using Java
- Is java.sql.Timestamp timezone specific?
- SQlite Getting nearest locations (with latitude and longitude)
- Set and Get Methods in java?
- Faster alternatives to Java’s reflection [closed]
- How to manage exceptions thrown in filters in Spring?
- How do you specify the root context in your tags in web.xml?
- Exception in thread “main” java.lang.IllegalStateException: The driver executable does not exist while running Selenium Test on Ubuntu
- JSON character encoding
- Constructing regex pattern to match sentence
- How to get the line number of a method?
- Adding external resources to class-path in Tomcat 8
- How to reload properties with Spring?
- How can I change the highlight color of a focused JComboBox
- JavaFX and maven: NullPointerException: Location is required
- Javadoc reuse for overloaded methods
- Java: non-heap-memory analyzes
- Error creating bean with name ‘entityManagerFactory
- Customize JOptionPane Dialog
- Static methods and their overriding
- Is 00 an integer or octal in Java?
- Exception in thread “main” java.util.NoSuchElementException: No line found – Using scanner input [duplicate]