1 /* 2 * Copyright 2021 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.google.android.enterprise.connectedapps.internal; 17 18 /** This class is only for internal use by the SDK. */ 19 public final class ByteUtilities { ByteUtilities()20 private ByteUtilities() {} 21 22 /** Join two byte arrays into a single byte array, with firstArray followed by secondArray. */ joinByteArrays(byte[] firstArray, byte[] secondArray)23 public static byte[] joinByteArrays(byte[] firstArray, byte[] secondArray) { 24 byte[] results = new byte[firstArray.length + secondArray.length]; 25 System.arraycopy(firstArray, 0, results, 0, firstArray.length); 26 System.arraycopy(secondArray, 0, results, firstArray.length, secondArray.length); 27 return results; 28 } 29 } 30