anchor.diff:  ﻿namespace FSharp.IO
   
   open System
  +#if NET40
  +open System.Diagnostics.Contracts
  +#else
  +open System.Diagnostics
  +#endif
   open System.IO
   open FSharp.Control
   open FSharpx
  
positive.code:     override x.SetLength(value) = raise <| new NotSupportedException()
  
      override x.Read(buffer, offset, count) =
          if buffer = null then
              raise <| new ArgumentNullException("buffer")
          if offset < 0 || offset >= buffer.Length then
              raise <| new ArgumentOutOfRangeException("offset")
          if count < 0 || offset + count > buffer.Length then
              raise <| new ArgumentOutOfRangeException("count")
  
          if count = 0 then 0 else
          let chunk = queue.Dequeue(count)
  
negative.code:             return chunk.Length }
  
      member x.AsyncWrite(buffer: byte[], offset, count, ?timeout) =
          #if NET40
          Contract.Requires(buffer <> null, "buffer cannot be null")
          Contract.Requires(offset >= 0 && offset < buffer.Length, "offset is out of range")
          Contract.Requires(count >= 0 && offset + count <= buffer.Length, "count is out of range")
          #else
          Debug.Assert(buffer <> null, "buffer cannot be null")
          Debug.Assert(offset >= 0 && offset < buffer.Length, "offset is out of range")
          Debug.Assert(count >= 0 && offset + count <= buffer.Length, "count is out of range")
          #endif
  
          if count = 0 then async.Return() else
          queue.AsyncEnqueue(buffer, offset, count, ?timeout = timeout)
  