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