Java Unsigned Byte Create toUnsignedBytes(long convert)

Here you can find the source of toUnsignedBytes(long convert)

Description

to Unsigned Bytes

License

Open Source License

Declaration

public static byte[] toUnsignedBytes(long convert) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static byte[] toUnsignedBytes(long convert) {
        byte[] bytes = new byte[4];
        for (int i = 0; i < bytes.length; i++) {
            bytes[i] = (byte) (convert >> i * 8);
        }//from  w ww .  j ava2  s.  c  o m
        return bytes;
    }
}

Related

  1. toUnsignedByte(byte[] buf, int pos)
  2. toUnsignedByte(char[] bytes, boolean le)
  3. toUnsignedByte(int value)
  4. toUnsignedByte(int value)
  5. toUnsignedByteArray(byte[] b)