Here you can find the source of appendByte(byte[] bytes, byte b)
public static byte[] appendByte(byte[] bytes, byte b)
//package com.java2s; //License from project: Apache License import java.util.Arrays; public class Main { public static byte[] appendByte(byte[] bytes, byte b) { byte[] result = Arrays.copyOf(bytes, bytes.length + 1); result[result.length - 1] = b;//from w w w. ja v a 2 s .c o m return result; } }