public static NSObject observeReadToEndOfFileCompletion(NSFileHandle object, final VoidBlock2<NSFileHandle, NSData> block) { return NSNotificationCenter.getDefaultCenter().addObserver(ReadToEndOfFileCompletionNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { NSData d = null; NSDictionary<?, ?> data = a.getUserInfo(); if (data.containsKey(NotificationDataItem())) { d = (NSData)data.get(NotificationDataItem()); } block.invoke((NSFileHandle)a.getObject(), d); } }); } public static NSObject observeConnectionAccepted(NSFileHandle object, final VoidBlock2<NSFileHandle, NSFileHandle> block) {
public static NSObject observeReadToEndOfFileCompletion(NSFileHandle object, final VoidBlock2<NSFileHandle, NSData> block) { return NSNotificationCenter.getDefaultCenter().addObserver(ReadToEndOfFileCompletionNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { NSData d = null; NSDictionary<?, ?> data = a.getUserInfo(); if (data.containsKey(NotificationDataItem())) { d = (NSData)data.get(NotificationDataItem()); } block.invoke((NSFileHandle)a.getObject(), d); } }); } public static NSObject observeConnectionAccepted(NSFileHandle object, final VoidBlock2<NSFileHandle, NSFileHandle> block) {
public static NSObject observeReadToEndOfFileCompletion(NSFileHandle object, final VoidBlock2<NSFileHandle, NSData> block) { return NSNotificationCenter.getDefaultCenter().addObserver(ReadToEndOfFileCompletionNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { NSData d = null; NSDictionary<?, ?> data = a.getUserInfo(); if (data.containsKey(NotificationDataItem())) { d = (NSData)data.get(NotificationDataItem()); } block.invoke((NSFileHandle)a.getObject(), d); } }); } public static NSObject observeConnectionAccepted(NSFileHandle object, final VoidBlock2<NSFileHandle, NSFileHandle> block) {