Skip to content

timelyraining/CocoaDataInputOutputStream

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CocoaDataInputOutputStream

Interfacing Objective-C/Cocoa apps with Java's DataInput/DataOutput streams.

Example

DataInputOutputStream* DIOS = [[DataInputOutputStream alloc] init];
[DIOS connectToHost:@"localhost" port:2999];

[DIOS writeInt:39943];
NSLog(@"%d", [DIOS readByte]);

Be forewarned, read methods block! This library was written for an app with a hard-set protocol, with very constantly moving, fixed-length data!

The available methods are:

-(BOOL)connectToHost:(NSString*)hostname port:(int)port;
-(void)writeInt:(uint32_t)send;
-(uint32_t)readInt;
-(void)writeShort:(short)send;
-(short)readShort;
-(void)writeByte:(uint8_t)send;
-(uint8_t)readByte;
-(void)writeLong:(long)send;
-(long)readLong;
-(double)readDouble;
-(unichar)readChar;
-(void)writeChar:(unichar)tosend;
-(NSString*)readString;
-(boolean_t)readBool;
-(void)writeBool:(boolean_t)value;
-(void)writeDouble:(double)sendDouble;
-(void)writeFloat:(float)sendFloat;
-(float)readFloat;

-(void)writeString:(NSString*)tosendstring;

About

Interfacing Objective-C/Cocoa apps with Java's DataInput/DataOutput streams.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 100.0%