Java Integer Format formatInteger(byte[] btValue, int iOffset, int iLength)

Here you can find the source of formatInteger(byte[] btValue, int iOffset, int iLength)

Description

format Integer

License

Apache License

Declaration

public static String formatInteger(byte[] btValue, int iOffset,
            int iLength) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String formatInteger(byte[] btValue, int iOffset,
            int iLength) {
        int iLastOffset = iOffset + iLength;
        if (btValue.length < iLastOffset || iLength < 1)
            return "";
        int iValue = 0;
        for (int iIndex = iOffset; iIndex < iLastOffset; iIndex++) {
            iValue <<= 8;//  ww  w  .  jav  a  2 s  .com
            iValue |= (btValue[iIndex] & 0xFF);
        }
        return String.valueOf(iValue);
    }
}

Related

  1. formatInt(String value, int defaultValue)
  2. formatInt2(int n)
  3. formatInt64(long val)
  4. formatIntAsDottedOctet(int value)
  5. formatIntAsIpAddress(final int address)
  6. formatInteger(int i, int j)
  7. formatInteger(int inInt, int inLen, boolean inComma, int inCommaPos)
  8. formatInteger(int integer, int length)
  9. formatInteger(int value, int length)