summaryrefslogtreecommitdiff
path: root/common/device/com/android/net/module/util/async/FileHandle.java
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-11-02 22:41:23 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-11-02 22:41:23 +0000
commit9f5e7298018186095f0a934915b9e5b260a223e2 (patch)
tree13f4a3881fc99fd0050781e1dc3962d5da6789a1 /common/device/com/android/net/module/util/async/FileHandle.java
parent7d736e9bbdee02ad4e52d9e609d8637d10d862f9 (diff)
parent5cb6b26d6110fae0309a9222e4da8a869eb49e0d (diff)
downloadnet-android14-mainline-resolv-release.tar.gz
Snap for 11041982 from 5cb6b26d6110fae0309a9222e4da8a869eb49e0d to mainline-resolv-releaseaml_res_341510000aml_res_341410010aml_res_341311030android14-mainline-resolv-release
Change-Id: Icf2a81bae3f7fdcbab100aeca9dbb05bd2eafcb4
Diffstat (limited to 'common/device/com/android/net/module/util/async/FileHandle.java')
-rw-r--r--common/device/com/android/net/module/util/async/FileHandle.java74
1 files changed, 0 insertions, 74 deletions
diff --git a/common/device/com/android/net/module/util/async/FileHandle.java b/common/device/com/android/net/module/util/async/FileHandle.java
deleted file mode 100644
index 9f7942d4..00000000
--- a/common/device/com/android/net/module/util/async/FileHandle.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2022 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 com.android.net.module.util.async;
-
-import android.os.ParcelFileDescriptor;
-
-import java.io.Closeable;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-/**
- * Represents an file descriptor or another way to access a file.
- *
- * @hide
- */
-public final class FileHandle {
- private final ParcelFileDescriptor mFd;
- private final Closeable mCloseable;
- private final InputStream mInputStream;
- private final OutputStream mOutputStream;
-
- public static FileHandle fromFileDescriptor(ParcelFileDescriptor fd) {
- if (fd == null) {
- throw new NullPointerException();
- }
- return new FileHandle(fd, null, null, null);
- }
-
- public static FileHandle fromBlockingStream(
- Closeable closeable, InputStream is, OutputStream os) {
- if (closeable == null || is == null || os == null) {
- throw new NullPointerException();
- }
- return new FileHandle(null, closeable, is, os);
- }
-
- private FileHandle(ParcelFileDescriptor fd, Closeable closeable,
- InputStream is, OutputStream os) {
- mFd = fd;
- mCloseable = closeable;
- mInputStream = is;
- mOutputStream = os;
- }
-
- ParcelFileDescriptor getFileDescriptor() {
- return mFd;
- }
-
- Closeable getCloseable() {
- return mCloseable;
- }
-
- InputStream getInputStream() {
- return mInputStream;
- }
-
- OutputStream getOutputStream() {
- return mOutputStream;
- }
-}