Java Unsigned Number Create unsignedHalfwordToString(int value)

Here you can find the source of unsignedHalfwordToString(int value)

Description

Interprets the lowest 16 bits of the specified value as an unsigned integer number and renders that number as a four-digit hex string.

License

Open Source License

Parameter

Parameter Description
value the value to render

Return

Returns the rendered value

Declaration

public static String unsignedHalfwordToString(int value) 

Method Source Code

//package com.java2s;
/**/*from  w  w  w .ja  v  a 2s . co  m*/
 * Copyright (c) 2010 Martin Geisse
 *
 * This file is distributed under the terms of the MIT license.
 */

public class Main {
    /**
     * Interprets the lowest 16 bits of the specified value as an
     * unsigned integer number and renders that number as a four-digit
     * hex string.
     * @param value the value to render
     * @return Returns the rendered value
     */
    public static String unsignedHalfwordToString(int value) {
        return String.format("%04x", value & 0xffff);
    }
}

Related

  1. unsignedCharToInt(byte[] b)
  2. unsignedCompare(long left, long right)
  3. unsignedConstraintValue(double v, double min, double max)
  4. unsignedDiv(long l1, long l2)
  5. unsignedExtend(String hex)
  6. unsignedInt(byte b)
  7. unsignedInt(int i)
  8. unsignedInt(int value)
  9. unsignedInt2ByteLE(byte[] bytes, long value, int offset)