// returns in O(1) a pointer to the buffer in 'buffer' and by reference in 'len' how many bytes are available. This buffer is only valid until the next stream operation. Subclassers may return NO for this if it is not appropriate for the stream type. This may return NO if the buffer is not available. @property (readonly) BOOL hasBytesAvailable;
//NSURLProtocol.h/*! @method canInitWithRequest: @abstract This method determines whether this protocol can handle the given request. @discussion A concrete subclass should inspect the given request and determine whether or not the implementation can perform a load with that request. This is an abstract method. Sublasses must provide an implementation. @param request A request to inspect. @result YES if the protocol can handle the given request, NO if not.*/+ (BOOL)canInitWithRequest:(NSURLRequest *)request;/*! @method canonicalRequestForRequest: @abstract This method returns a canonical version of the given request. @discussion It is up to each concrete protocol implementation to define what "canonical" means. However, a protocol should guarantee that the same input request always yields the same canonical form. Special consideration should be given when implementing this method since the canonical form of a request is used to look up objects in the URL cache, a process which performs equality checks between NSURLRequest objects.
This is an abstract method; sublasses must provide an implementation. @param request A request to make canonical. @result The canonical form of the given request. */+ (NSURLRequest *)canonicalRequestForRequest:(NSURLRequest *)request;