<commit_before>using System;
using System.Runtime.InteropServices;

using MonoTouch.CoreFoundation;
using MonoTouch.Foundation;

namespace InputStreamTest
{
	[Preserve (AllMembers = true)]
	public class ZInputStream : NSInputStream
	{
		NSStreamStatus status;
		long read_length;
		long total_length;
		
		public ZInputStream (long total_length) : base ()
		{
			status = NSStreamStatus.NotOpen;
			this.total_length = total_length;
		}
		
		public override NSStreamStatus Status {
			get {
				return status;
			}
		}
		
		public override void Open ()
		{
			status = NSStreamStatus.Open;
			Notify (CFStreamEventType.OpenCompleted);
		}
		
		public override void Close ()
		{
			status = NSStreamStatus.Closed;
		}
		
		public override bool HasBytesAvailable ()
		{
			return total_length > read_length;
		}
	
		public override int Read (IntPtr buffer, uint len) 
		{
			int actual = Math.Min ((int) len, (int) (total_length - read_length));
			
			byte [] bytes = new byte [actual];
			for (int i = 0; i < actual; i++)
				bytes [i] = (byte) 'z';
			
			read_length += actual;
			
			Marshal.Copy (bytes, 0, buffer, actual);
			
			if (actual == 0)
				Notify (CFStreamEventType.EndEncountered);
			
			return actual;
		}
		
		protected unsafe override bool GetBuffer (out IntPtr buffer, out uint len)
		{
			// Just call the base implemention (which will return false)
			return base.GetBuffer (out buffer, out len);
		}
		
		protected override bool SetCFClientFlags (CFStreamEventType inFlags, IntPtr inCallback, IntPtr inContextPtr)
		{
			// Just call the base implementation, which knows how to handle everything.
			return base.SetCFClientFlags (inFlags, inCallback, inContextPtr);
		}
		
		public override void ScheduleInCFRunLoop (CFRunLoop runloop, NSString mode)
		{
			Notify (CFStreamEventType.HasBytesAvailable);
		}
		
		public override void UnscheduleInCFRunLoop (CFRunLoop runloop, NSString mode)
		{
			// Nothing to do here
		}
	}
}
<commit_msg>CustomInputStream: [Un]scheduleInCFRunLoop has been removed from Xamarin.iOS, so export manually here.<commit_after>using System;
using System.Runtime.InteropServices;

using MonoTouch.CoreFoundation;
using MonoTouch.Foundation;

namespace InputStreamTest
{
	[Preserve (AllMembers = true)]
	public class ZInputStream : NSInputStream
	{
		NSStreamStatus status;
		long read_length;
		long total_length;
		
		public ZInputStream (long total_length) : base ()
		{
			status = NSStreamStatus.NotOpen;
			this.total_length = total_length;
		}
		
		public override NSStreamStatus Status {
			get {
				return status;
			}
		}
		
		public override void Open ()
		{
			status = NSStreamStatus.Open;
			Notify (CFStreamEventType.OpenCompleted);
		}
		
		public override void Close ()
		{
			status = NSStreamStatus.Closed;
		}
		
		public override bool HasBytesAvailable ()
		{
			return total_length > read_length;
		}
	
		public override int Read (IntPtr buffer, uint len) 
		{
			int actual = Math.Min ((int) len, (int) (total_length - read_length));
			
			byte [] bytes = new byte [actual];
			for (int i = 0; i < actual; i++)
				bytes [i] = (byte) 'z';
			
			read_length += actual;
			
			Marshal.Copy (bytes, 0, buffer, actual);
			
			if (actual == 0)
				Notify (CFStreamEventType.EndEncountered);
			
			return actual;
		}
		
		protected unsafe override bool GetBuffer (out IntPtr buffer, out uint len)
		{
			// Just call the base implemention (which will return false)
			return base.GetBuffer (out buffer, out len);
		}
		
		protected override bool SetCFClientFlags (CFStreamEventType inFlags, IntPtr inCallback, IntPtr inContextPtr)
		{
			// Just call the base implementation, which knows how to handle everything.
			return base.SetCFClientFlags (inFlags, inCallback, inContextPtr);
		}

		[Export ("_scheduleInCFRunLoop:forMode:")]
		public void ScheduleInCFRunLoop (CFRunLoop runloop, NSString mode)
		{
			Notify (CFStreamEventType.HasBytesAvailable);
		}

		[Export ("_unscheduleFromCFRunLoop:forMode:")]
		public void UnscheduleInCFRunLoop (CFRunLoop runloop, NSString mode)
		{
			// Nothing to do here
		}
	}
}

{'fraction_non_alphanumeric': 0.08893232347911068, 'fraction_numerical': 0.0014659174199853407, 'mean_word_length': 3.4939626783754116, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1343347', 'n_tokens_mistral': 1482, 'n_tokens_neox': 1228, 'n_words': 372}