+ [delegate newDataAdded:self];
+}
+
+-(void) writeBytes:(in char *)b len:(long)length
+{
+ [lock lock];
+ [data appendBytes:b length:length];
+ [lock unlock];
+ [delegate newDataAdded:self];
+}
+
+-(void) lockStream
+{
+ [lock lock];
+}
+
+-(void) unlockStream
+{
+ [lock unlock];
+}
+
+-(void) shortenData:(long)length
+{
+ NSRange range = {0, length};
+ [data replaceBytesInRange:range withBytes:nil length:0];