X-Git-Url: http://git.ithinksw.org/ITFoundation.git/blobdiff_plain/d0e2a23f6909335baea90af08491a5160026757b..692faf9cb79903190c1885a7ed08a2c97cc7fb8b:/ITByteStream.h diff --git a/ITByteStream.h b/ITByteStream.h old mode 100755 new mode 100644 index eeb9c76..a2193d6 --- a/ITByteStream.h +++ b/ITByteStream.h @@ -1,24 +1,46 @@ -// -// ITByteStream.h -// ITFoundation -// -// Created by Alexander Strange on Thu Feb 27 2003. -// Copyright (c) 2003 __MyCompanyName__. All rights reserved. -// +/* + * ITFoundation + * ITByteStream.h + * + * Copyright (c) 2005 by iThink Software. + * All Rights Reserved. + * + * $Id$ + * + */ #import -/*! @class ITByteStream - * @abstract A FIFO bytestream - */ -@interface ITByteStream : NSObject { - NSMutableData *data; - @private - NSLock *lock; -} --(id) initWithStream:(ITByteStream*)stream; --(int) availableDataLength; --(NSData*) readDataOfLength:(int)length; --(NSData*) readAllData; --(void) writeData:(in NSData*)data; +@protocol ITDataReceiver; + +@protocol ITDataProvider +- (id )setDelegate:(id )delegate; +- (id )delegate; +@end + +@protocol ITDataReceiver +-(oneway void)newDataAdded:(id )sender; @end + +@interface ITByteStream : NSObject { + @public + NSMutableData *data; + @private + NSLock *lock; + id delegate; +} + +- (id)initWithDelegate:(id )delegate; +- (id)initWithStream:(ITByteStream *)stream delegate:(id )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 )setDelegate:(id )delegate; +- (id )delegate; + +@end \ No newline at end of file