Class NSFileHandle

All Implemented Interfaces:
NSCoding, NSObjectProtocol, NSSecureCoding, ObjCProtocol

public class NSFileHandle
extends NSObject
implements NSSecureCoding
  • Constructor Details

    • NSFileHandle

      public NSFileHandle()
    • NSFileHandle

      protected NSFileHandle​(NSObject.Handle h, long handle)
    • NSFileHandle

      protected NSFileHandle​(NSObject.SkipInit skipInit)
    • NSFileHandle

      public NSFileHandle​(int fd, boolean closeopt)
    • NSFileHandle

      public NSFileHandle​(NSCoder coder)
    • NSFileHandle

      public NSFileHandle​(int fd)
  • Method Details

    • getAvailableData

      public NSData getAvailableData()
    • getStandardInput

      public static NSFileHandle getStandardInput()
    • getStandardOutput

      public static NSFileHandle getStandardOutput()
    • getStandardError

      public static NSFileHandle getStandardError()
    • getNullDevice

      public static NSFileHandle getNullDevice()
    • getReadabilityHandler

      public VoidBlock1<NSFileHandle> getReadabilityHandler()
    • setReadabilityHandler

      public void setReadabilityHandler​(VoidBlock1<NSFileHandle> v)
    • getWriteabilityHandler

      public VoidBlock1<NSFileHandle> getWriteabilityHandler()
    • setWriteabilityHandler

      public void setWriteabilityHandler​(VoidBlock1<NSFileHandle> v)
    • getFileDescriptor

      public int getFileDescriptor()
    • getOffsetInFile

      @Deprecated public long getOffsetInFile()
      Deprecated.
      Use getOffset:error:
    • supportsSecureCoding

      public static boolean supportsSecureCoding()
    • readInBackgroundAndNotify

      public void readInBackgroundAndNotify​(NSRunLoopMode... modes)
    • readToEndOfFileInBackgroundAndNotify

      public void readToEndOfFileInBackgroundAndNotify​(NSRunLoopMode... modes)
    • acceptConnectionInBackgroundAndNotify

      public void acceptConnectionInBackgroundAndNotify​(NSRunLoopMode... modes)
    • waitForDataInBackgroundAndNotify

      public void waitForDataInBackgroundAndNotify​(NSRunLoopMode... modes)
    • ReadCompletionNotification

      public static NSString ReadCompletionNotification()
    • ReadToEndOfFileCompletionNotification

      public static NSString ReadToEndOfFileCompletionNotification()
    • ConnectionAcceptedNotification

      public static NSString ConnectionAcceptedNotification()
    • DataAvailableNotification

      public static NSString DataAvailableNotification()
    • NotificationDataItem

      protected static NSString NotificationDataItem()
    • NotificationFileHandleItem

      protected static NSString NotificationFileHandleItem()
    • init

      protected long init​(int fd, boolean closeopt)
    • init

      protected long init​(NSCoder coder)
    • readDataToEndOfFileEx

      public NSData readDataToEndOfFileEx() throws NSErrorException
      Throws:
      NSErrorException
      Since:
      Available in iOS 13.0 and later.
    • readDataUpToLengthEx

      public NSData readDataUpToLengthEx​(long length) throws NSErrorException
      Throws:
      NSErrorException
      Since:
      Available in iOS 13.0 and later.
    • writeDataEx

      public boolean writeDataEx​(NSData data) throws NSErrorException
      Throws:
      NSErrorException
      Since:
      Available in iOS 13.0 and later.
    • getOffsetEx

      public boolean getOffsetEx​(LongPtr offsetInFile) throws NSErrorException
      Throws:
      NSErrorException
      Since:
      Available in iOS 13.0 and later.
    • seekToEndReturningOffsetEx

      public boolean seekToEndReturningOffsetEx​(LongPtr offsetInFile) throws NSErrorException
      Throws:
      NSErrorException
      Since:
      Available in iOS 13.0 and later.
    • seekToOffsetEx

      public boolean seekToOffsetEx​(long offset) throws NSErrorException
      Throws:
      NSErrorException
      Since:
      Available in iOS 13.0 and later.
    • truncateAtOffsetEx

      public boolean truncateAtOffsetEx​(long offset) throws NSErrorException
      Throws:
      NSErrorException
      Since:
      Available in iOS 13.0 and later.
    • synchronizeAndReturnError

      public boolean synchronizeAndReturnError​(NSError.NSErrorPtr error)
      Since:
      Available in iOS 13.0 and later.
    • closeAndReturnError

      public boolean closeAndReturnError​(NSError.NSErrorPtr error)
      Since:
      Available in iOS 13.0 and later.
    • createForReading

      public static NSFileHandle createForReading​(String path)
    • createForWriting

      public static NSFileHandle createForWriting​(String path)
    • createForUpdating

      public static NSFileHandle createForUpdating​(String path)
    • createForReading

      public static NSFileHandle createForReading​(NSURL url) throws NSErrorException
      Throws:
      NSErrorException
    • createForWriting

      public static NSFileHandle createForWriting​(NSURL url) throws NSErrorException
      Throws:
      NSErrorException
    • createForUpdating

      public static NSFileHandle createForUpdating​(NSURL url) throws NSErrorException
      Throws:
      NSErrorException
    • readInBackgroundAndNotify

      public void readInBackgroundAndNotify​(List<String> modes)
    • readInBackgroundAndNotify

      public void readInBackgroundAndNotify()
    • readToEndOfFileInBackgroundAndNotify

      public void readToEndOfFileInBackgroundAndNotify​(List<String> modes)
    • readToEndOfFileInBackgroundAndNotify

      public void readToEndOfFileInBackgroundAndNotify()
    • acceptConnectionInBackgroundAndNotify

      public void acceptConnectionInBackgroundAndNotify​(List<String> modes)
    • acceptConnectionInBackgroundAndNotify

      public void acceptConnectionInBackgroundAndNotify()
    • waitForDataInBackgroundAndNotify

      public void waitForDataInBackgroundAndNotify​(List<String> modes)
    • waitForDataInBackgroundAndNotify

      public void waitForDataInBackgroundAndNotify()
    • init

      protected long init​(int fd)
    • readDataToEndOfFile

      @Deprecated public NSData readDataToEndOfFile()
      Deprecated.
      Use readDataToEndOfFileAndReturnError:
    • readData

      @Deprecated public NSData readData​(long length)
      Deprecated.
      Use readDataUpToLength:error:
    • writeData

      @Deprecated public void writeData​(NSData data)
      Deprecated.
      Use writeData:error:
    • seekToEndOfFile

      @Deprecated public long seekToEndOfFile()
      Deprecated.
      Use seekToEndReturningOffset:error:
    • seekToFileOffset

      @Deprecated public void seekToFileOffset​(long offset)
      Deprecated.
      Use seekToOffset:error:
    • truncateFile

      @Deprecated public void truncateFile​(long offset)
      Deprecated.
      Use truncateAtOffset:error:
    • synchronizeFile

      @Deprecated public void synchronizeFile()
      Deprecated.
      Use synchronizeAndReturnError:
    • closeFile

      @Deprecated public void closeFile()
      Deprecated.
      Use closeAndReturnError:
    • encode

      public void encode​(NSCoder coder)
      Specified by:
      encode in interface NSCoding