Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // DataQueue.h
- // MineHelmet
- //
- // Created by Dylan Lukes on 10/25/10.
- // Copyright 2010 Dylan Lukes. All rights reserved.
- //
- #import <Cocoa/Cocoa.h>
- @interface DataQueue : NSObject {
- NSMutableData *inData;
- NSData *outData;
- // Indicates the farthest index not yet dequeued
- NSUInteger offset;
- }
- // Appends data to the inData buffer
- - (void)enqueueBytes:(const void *)bytes length:(NSUInteger)length;
- - (void)enqueueData:(NSData*)data;
- // Returns a pointer to the proper location in the outData
- - (void)peekBytes:(const void **)data length:(NSUInteger *)length;
- // Increments the offset
- - (void)dequeueBytes:(NSInteger)amount;
- // Returns whether there is more data.
- - (BOOL)hasMoreData;
- @end
Add Comment
Please, Sign In to add comment