• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Wrap NSFileHandle or Subclass NSInputStream?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Wrap NSFileHandle or Subclass NSInputStream?


  • Subject: Wrap NSFileHandle or Subclass NSInputStream?
  • From: Duncan Anker <email@hidden>
  • Date: Mon, 08 May 2006 12:15:25 +1000

Hi List,

I am playing around with the concept of override files - that is, using a file if it exists or using an NSData object if it does not.

My initial thought was to wrap an NSFileHandle in one class and NSData in another, implementing a class cluster to present a common API. I then discovered that NSInputStream offers the functionality to use either a file or data which seems to be pretty close to what I want. The only thing is would need random access to the stream and abilities to e.g. calculate the length, so it seems I would need to subclass NSInputStream and implement the functionality already provided by NSFileHandle.

So which is the better approach? Wrap NSFileHandle and NSData, then implement "file" position and seeking methods on the data object, and have it all hide in a class cluster, or subclass NSInputStream and reimplement most of what NSFileHandle already gives me except extended to cope with NSData as well?

Adv thanks ance

Duncan

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: object type testing
  • Next by Date: addSubview NSOpenGLView to NSView and NSConnection
  • Previous by thread: -[NSEvent window] for NSPeriodic event?
  • Next by thread: addSubview NSOpenGLView to NSView and NSConnection
  • Index(es):
    • Date
    • Thread