Java Integer Convert To fromIntWithPrefix(byte prefix, int v)

Here you can find the source of fromIntWithPrefix(byte prefix, int v)

Description

from Int With Prefix

License

Open Source License

Declaration

public static byte[] fromIntWithPrefix(byte prefix, int v) 

Method Source Code

//package com.java2s;
/**//from w w  w  .j  a  v  a  2 s.c o m
 * Copyright 2012-2013 Johns Hopkins University HLTCOE. All rights reserved.
 * This software is released under the 2-clause BSD license.
 * See LICENSE in the project root directory.
 */

public class Main {
    public static byte[] fromIntWithPrefix(byte prefix, int v) {
        return new byte[] { prefix, (byte) ((v >> 24) & 0xff), (byte) ((v >> 16) & 0xff), (byte) ((v >> 8) & 0xff),
                (byte) ((v >> 0) & 0xff), };
    }
}

Related

  1. fromIntegerString(String integerString)
  2. fromInternalForm(String internalForm)
  3. fromIntLong(byte[] value)
  4. fromInts(int[] values)
  5. fromIntString(Object obj)
  6. IntegerTo(Integer i)
  7. integerToASCII(int number)
  8. integerToByte(int i)
  9. IntegerTochar(final Integer value)