--(id) init
-{
- if (self == [super init])
- {
- data = [[NSMutableData alloc] init];
- lock = [[NSLock alloc] init];
- delegate = nil;
- }
- return self;
+
+- (id)init {
+ if (self == [super init]) {
+ data = [[NSMutableData alloc] init];
+ lock = [[NSLock alloc] init];
+ delegate = nil;
+ }
+ return self;
+}
+
+- (id)initWithDelegate:(id <ITDataReceiver>)d {
+ if (self == [super init]) {
+ data = [[NSMutableData alloc] init];
+ lock = [[NSLock alloc] init];
+ delegate = [d retain];
+ }
+ return self;
+}
+
+- (id)initWithStream:(ITByteStream*)stream delegate:(id <ITDataReceiver>)d {
+ if (self == [super init]) {
+ data = [stream->data copy];
+ lock = [[NSLock alloc] init];
+ delegate = [d retain];
+ }
+ return 0;