-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathITByteStream.h
43 lines (36 loc) · 1022 Bytes
/
ITByteStream.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* ITFoundation
* ITByteStream.h
*
* Copyright (c) 2005 iThink Software
*
*/
#import <Foundation/Foundation.h>
@protocol ITDataReceiver;
@protocol ITDataProvider <NSObject>
- (id <ITDataReceiver>)setDelegate:(id <ITDataReceiver>)delegate;
- (id <ITDataReceiver>)delegate;
@end
@protocol ITDataReceiver <NSObject>
-(oneway void)newDataAdded:(id <ITDataProvider>)sender;
@end
@interface ITByteStream : NSObject <ITDataProvider> {
@public
NSMutableData *data;
@private
NSLock *lock;
id <ITDataReceiver> delegate;
}
- (id)initWithDelegate:(id <ITDataReceiver>)delegate;
- (id)initWithStream:(ITByteStream *)stream delegate:(id <ITDataReceiver>)d;
- (int)availableDataLength;
- (NSData*)readDataOfLength:(int)length;
- (NSData*)readAllData;
- (void)writeData:(in NSData *)data;
- (void)writeBytes:(in char *)b len:(long)length;
- (void)lockStream;
- (void)unlockStream;
- (void)shortenData:(long)length;
- (id <ITDataReceiver>)setDelegate:(id <ITDataReceiver>)delegate;
- (id <ITDataReceiver>)delegate;
@end