J2ME????????????????????
????????? ???????[ 2010/6/8 13:36:58 ] ????????
public class Arrays {
/**
* ????????У?????????????????:????.??????? ?? ????.??????? ??????????????
* ????????????????????????????з???
*/
private Arrays() {
}
/**
* ??????????byte?????????byte????
* @param rSource ?byte????
* @return ???byte[]?????????byte[]????
*/
????static public byte[] copy(byte[] rSource) {
????????byte[] aResult = new byte[rSource.length];
????????System.arraycopy(rSource?? 0?? aResult?? 0?? aResult.length);
????????return aResult;
????}
/**
* ??????????int?????????int????
* @param rSource ?int????
* @return ???int?????????int????
*/
????static public int[] copy(int[] rSource) {
????????int[] aResult = new int[rSource.length];
????????System.arraycopy(rSource?? 0?? aResult?? 0?? aResult.length);
????????return aResult;
????}
/**
* ???????byte????????????????????.
* @param a1 ?????byte????
* @param a2 ?????byte????
* @return ?????????true????????false
*/
????static public boolean equals(byte[] a1?? byte[] a2) {
????????if ( (a1 == null) || (a2 == null)) {
????????????return a1 == a2;
????????}
????????int nLength = a1.length;
????????if (nLength != a2.length) {
????????????return false;
????????}
????????for (int i = 0; i < nLength; i++) {
????????????if (a1[i] != a2[i]) {
????????????return false;
????????????}
????????}
????????return true;
????}
/**
* ???????int????????????????????.
* @param a1 ?????int????
* @param a2 ?????int????
* @return ?????????true????????false
*/
????static public boolean equals(int[] a1?? int[] a2) {
????????if ( (a1 == null) || (a2 == null)) {
????????????return a1 == a2;
????????}
????????int nLength = a1.length;
????????if (nLength != a2.length) {
????????return false;
????????}
????????for (int i = 0; i < nLength; i++) {
????????????if (a1[i] != a2[i]) {
????????????return false;
????????????}
????????}
????????return true;
????}
/**
* ????????byte???飬?????????μ???????byte????
* @param a1
* @param a2
* @return ????μ???????byte????
*/
????static public byte[] join(byte[] a1?? byte[] a2) {
????????byte[] result = new byte[a1.length + a2.length];
????????System.arraycopy(a1?? 0?? result?? 0?? a1.length);
????????System.arraycopy(a2?? 0?? result?? a1.length?? a2.length);
????????return result;
????}
/**
* ????????int???飬?????????μ???????int????
* @param a1
* @param a2
* @return ????μ???????int????
*/
????static public int[] join(int[] a1?? int[] a2) {
????????int[] result = new int[a1.length + a2.length];
????????System.arraycopy(a1?? 0?? result?? 0?? a1.length);
????????System.arraycopy(a2?? 0?? result?? a1.length?? a2.length);
????????return result;
????}
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11