Converts a signed short value to an unsigned int value - Android java.lang

Android examples for java.lang:Short

Description

Converts a signed short value to an unsigned int value

Demo Code

import android.system.OsConstants;
import android.system.OsConstants;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.nio.BufferOverflowException;
import java.nio.BufferUnderflowException;
import java.nio.ByteBuffer;
import java.nio.ShortBuffer;

public class Main{

    /**//w  w w .ja v a 2  s .com
     * Converts a signed short value to an unsigned int value.  Needed
     * because Java does not have unsigned types.
     */
    private static int intAbs(short v) {
        return v & 0xFFFF;
    }

}

Related Tutorials