diff options
author | Remi NGUYEN VAN <reminv@google.com> | 2019-01-28 11:08:00 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-01-28 11:08:00 +0000 |
commit | 6af597d5a1eb9fe444aef23a77805e748f7efc22 (patch) | |
tree | 7b82d050641230b55c7b2d3485aefe99efab3c27 /src/android/net/util/NetworkStackUtils.java | |
parent | 3c361560c336eb80fb78a7605e0314046dd90eab (diff) | |
parent | abeaaf7473259517c872f6c0906bf6d0eb88be46 (diff) |
Merge "Add hidden utils and constants to NetworkStack"
Diffstat (limited to 'src/android/net/util/NetworkStackUtils.java')
-rw-r--r-- | src/android/net/util/NetworkStackUtils.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/android/net/util/NetworkStackUtils.java b/src/android/net/util/NetworkStackUtils.java new file mode 100644 index 0000000..6dcf0c0 --- /dev/null +++ b/src/android/net/util/NetworkStackUtils.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.net.util; + +/** + * Collection of utilities for the network stack. + */ +public class NetworkStackUtils { + + /** + * @return True if the array is null or 0-length. + */ + public static <T> boolean isEmpty(T[] array) { + return array == null || array.length == 0; + } +} |