#import <Foundation/Foundation.h>
@class ITByteStream;
-
-@protocol ITByteStreamDelegate <NSObject>
--(oneway void)newDataAdded:(ITByteStream *)sender;
+@protocol DataReciever <NSObject>
+-(oneway void)newDataAdded:(id)sender;
@end
-
@interface ITByteStream : NSObject {
@public
NSMutableData *data;
@private
NSLock *lock;
- id <ITByteStreamDelegate> delegate;
+ id <DataReciever> delegate;
}
--(id) initWithStream:(ITByteStream*)stream delegate:(id <ITByteStreamDelegate>)d;
--(id) initWithDelegate:(id <ITByteStreamDelegate>)d;
--(void) setDelegate:(id <ITByteStreamDelegate>)d;
+-(id) initWithStream:(ITByteStream*)stream delegate:(id <DataReciever>)d;
-(int) availableDataLength;
-(NSData*) readDataOfLength:(int)length;
-(NSData*) readAllData;
-(void) lockStream;
-(void) unlockStream;
-(void) shortenData:(long)length;
+-initWithDelegate:(id)delegate;
+-setDelegate:(id)delegate;
+-delegate;
@end