Java Integer to Byte Array intToBytesSizeOne(int integer)

Here you can find the source of intToBytesSizeOne(int integer)

Description

int To Bytes Size One

License

Apache License

Declaration

public static byte[] intToBytesSizeOne(int integer) 

Method Source Code

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

public class Main {
    public static byte[] intToBytesSizeOne(int integer) {
        byte[] bytes = new byte[1];
        bytes[0] = (byte) (integer);
        return bytes;
    }/*w w w  .  j  ava  2  s .com*/
}

Related

  1. IntToBytesLE(final long val)
  2. intToBytesLE(int i, byte[] bytes, int off)
  3. intToBytesLE(int value, byte[] buffer, int offset, int length)
  4. intToBytesLittleEndian(final int i, final byte[] dest, final int offset)
  5. intToBytesNoLeadZeroes(int val)