5 * Copyright (c) 2005 iThink Software
9 #import <Foundation/Foundation.h>
11 @protocol ITDataReceiver;
13 @protocol ITDataProvider <NSObject>
14 - (id <ITDataReceiver>)setDelegate:(id <ITDataReceiver>)delegate;
15 - (id <ITDataReceiver>)delegate;
18 @protocol ITDataReceiver <NSObject>
19 -(oneway void)newDataAdded:(id <ITDataProvider>)sender;
22 @interface ITByteStream : NSObject <ITDataProvider> {
27 id <ITDataReceiver> delegate;
30 - (id)initWithDelegate:(id <ITDataReceiver>)delegate;
31 - (id)initWithStream:(ITByteStream *)stream delegate:(id <ITDataReceiver>)d;
32 - (int)availableDataLength;
33 - (NSData*)readDataOfLength:(int)length;
34 - (NSData*)readAllData;
35 - (void)writeData:(in NSData *)data;
36 - (void)writeBytes:(in char *)b len:(long)length;
39 - (void)shortenData:(long)length;
40 - (id <ITDataReceiver>)setDelegate:(id <ITDataReceiver>)delegate;
41 - (id <ITDataReceiver>)delegate;