5 * Copyright (c) 2005 by iThink Software.
12 #import <Foundation/Foundation.h>
14 @protocol ITDataReceiver;
16 @protocol ITDataProvider <NSObject>
17 - (id <ITDataReceiver>)setDelegate:(id <ITDataReceiver>)delegate;
18 - (id <ITDataReceiver>)delegate;
21 @protocol ITDataReceiver <NSObject>
22 -(oneway void)newDataAdded:(id <ITDataProvider>)sender;
25 @interface ITByteStream : NSObject <ITDataProvider> {
30 id <ITDataReceiver> delegate;
33 - (id)initWithDelegate:(id <ITDataReceiver>)delegate;
34 - (id)initWithStream:(ITByteStream *)stream delegate:(id <ITDataReceiver>)d;
35 - (int)availableDataLength;
36 - (NSData*)readDataOfLength:(int)length;
37 - (NSData*)readAllData;
38 - (void)writeData:(in NSData *)data;
39 - (void)writeBytes:(in char *)b len:(long)length;
42 - (void)shortenData:(long)length;
43 - (id <ITDataReceiver>)setDelegate:(id <ITDataReceiver>)delegate;
44 - (id <ITDataReceiver>)delegate;