Package android.os
Class ParcelFileDescriptor.AutoCloseInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FileInputStream
-
- android.os.ParcelFileDescriptor.AutoCloseInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
- ParcelFileDescriptor
public static class ParcelFileDescriptor.AutoCloseInputStream extends FileInputStream
An InputStream you can create on a ParcelFileDescriptor, which will take care of callingParcelFileDescriptor.close()for you when the stream is closed.
-
-
Constructor Summary
Constructors Constructor Description AutoCloseInputStream(ParcelFileDescriptor pfd)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this stream.-
Methods inherited from class java.io.FileInputStream
available, finalize, getChannel, getFD, read, read, skip
-
Methods inherited from class java.io.InputStream
mark, markSupported, read, reset
-
-
-
-
Constructor Detail
-
AutoCloseInputStream
public AutoCloseInputStream(ParcelFileDescriptor pfd)
-
-
Method Detail
-
close
public void close() throws IOExceptionDescription copied from class:InputStreamCloses this stream. Concrete implementations of this class should free any resources during close. This implementation does nothing.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFileInputStream- Throws:
IOException- if an error occurs while closing this stream.
-
-