Class ParcelFileDescriptorRewinder

  • All Implemented Interfaces:
    DataRewinder<android.os.ParcelFileDescriptor>

    public final class ParcelFileDescriptorRewinder
    extends java.lang.Object
    implements DataRewinder<android.os.ParcelFileDescriptor>
    Implementation for ParcelFileDescriptors that rewinds file descriptors by seeking to 0.
    • Constructor Summary

      Constructors 
      Constructor Description
      ParcelFileDescriptorRewinder​(android.os.ParcelFileDescriptor parcelFileDescriptor)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cleanup()
      Called when this rewinder is no longer needed and can be cleaned up.
      static boolean isSupported()  
      android.os.ParcelFileDescriptor rewindAndGet()
      Rewinds the wrapped data back to the beginning and returns the re-wound data (or a wrapper for the re-wound data).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ParcelFileDescriptorRewinder

        @RequiresApi(21)
        public ParcelFileDescriptorRewinder​(android.os.ParcelFileDescriptor parcelFileDescriptor)
    • Method Detail

      • isSupported

        public static boolean isSupported()
      • rewindAndGet

        @NonNull
        @RequiresApi(21)
        public android.os.ParcelFileDescriptor rewindAndGet()
                                                     throws java.io.IOException
        Description copied from interface: DataRewinder
        Rewinds the wrapped data back to the beginning and returns the re-wound data (or a wrapper for the re-wound data).
        Specified by:
        rewindAndGet in interface DataRewinder<android.os.ParcelFileDescriptor>
        Returns:
        An object pointing to the wrapped data.
        Throws:
        java.io.IOException
      • cleanup

        public void cleanup()
        Description copied from interface: DataRewinder
        Called when this rewinder is no longer needed and can be cleaned up.

        The underlying data may still be in use and should not be closed or invalidated.

        Specified by:
        cleanup in interface DataRewinder<android.os.ParcelFileDescriptor>