Give me a B! Give me a U! Give me a G!
[ITFoundation.git] / ITByteStream.m
index 67ecf31..b5554e1 100755 (executable)
 
 -(NSData*) readDataOfLength:(int)length
 {
-    NSData *ret, *tmp;
+    NSData *ret;
     NSRange range = {0, length};
     [lock lock];
     ret = [data subdataWithRange:range];
-#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED
     [data replaceBytesInRange:range withBytes:nil length:0];
-#else
-    range = {length, [data length]};
-    tmp = [data subdataWithRange:range];
-    [data setData:tmp];
-#endif
     [lock unlock];
     return ret;
 }
     [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];
+}
 @end