public static void CreateBoundPair(out NSInputStream readStream, out NSOutputStream writeStream, nint bufferSize) { IntPtr read, write; CFStream.CFStreamCreateBoundPair(IntPtr.Zero, out read, out write, bufferSize); AssignStreams(read, write, out readStream, out writeStream); }
public static void CreatePairWithSocketToHost(IPEndPoint endpoint, out NSInputStream readStream, out NSOutputStream writeStream) { using (var host = CFHost.Create(endpoint)) { IntPtr read, write; CFStream.CFStreamCreatePairWithSocketToCFHost(IntPtr.Zero, host.Handle, endpoint.Port, out read, out write); AssignStreams(read, write, out readStream, out writeStream); } }
public static void CreatePairWithPeerSocketSignature(AddressFamily family, SocketType type, ProtocolType proto, IPEndPoint endpoint, out NSInputStream readStream, out NSOutputStream writeStream) { using (var address = new CFSocketAddress(endpoint)) { var sig = new CFSocketSignature(family, type, proto, address); IntPtr read, write; CFStream.CFStreamCreatePairWithPeerSocketSignature(IntPtr.Zero, ref sig, out read, out write); AssignStreams(read, write, out readStream, out writeStream); } }
public static void CreatePairWithSocket(CFSocket socket, out NSInputStream readStream, out NSOutputStream writeStream) { if (socket == null) { throw new ArgumentNullException("socket"); } IntPtr read, write; CFStream.CFStreamCreatePairWithSocket(IntPtr.Zero, socket.GetNative(), out read, out write); AssignStreams(read, write, out readStream, out writeStream); }
static void AssignStreams(IntPtr read, IntPtr write, out NSInputStream readStream, out NSOutputStream writeStream) { readStream = Runtime.GetNSObject <NSInputStream> (read); writeStream = Runtime.GetNSObject <NSOutputStream> (write); }
public static int WriteJSONObject(AnyObject obj, NSOutputStream toStream, NSJSONWritingOptions options, NSErrorPointer error) { return(default(int)); }
public static int WritePropertyList(AnyObject plist, NSOutputStream toStream, NSPropertyListFormat format, NSPropertyListWriteOptions options, NSErrorPointer error) { return(default(int)); }
public static nint WritePropertyList(NSObject plist, NSOutputStream stream, NSPropertyListFormat format, out NSError error) { return(WritePropertyList(plist, stream, format, NSPropertyListWriteOptions.Immutable, out error)); }