GetWritableStream() публичный Метод

public GetWritableStream ( ) : RubyBufferedStream
Результат RubyBufferedStream
Пример #1
0
        public static int WriteNoBlock(RubyIO /*!*/ self, [NotNull] MutableString /*!*/ val)
        {
            var stream = self.GetWritableStream();

            try {
                stream.WriteTimeout = 0;
            } catch (InvalidOperationException) {
                throw RubyExceptions.CreateEBADF();
            }
            return(Write(self, val));
        }
Пример #2
0
        public static int SysWrite(BinaryOpStorage /*!*/ writeStorage, ConversionStorage <MutableString> /*!*/ tosConversion,
                                   RubyContext /*!*/ context, RubyIO /*!*/ self, [NotNull] MutableString /*!*/ val)
        {
            RubyBufferedStream stream = self.GetWritableStream();

            if (stream.DataBuffered)
            {
                PrintOps.ReportWarning(writeStorage, tosConversion, MutableString.CreateAscii("syswrite for buffered IO"));
            }
            int bytes = Write(self, val);

            self.Flush();
            return(bytes);
        }
Пример #3
0
 public static int WriteNoBlock(RubyIO/*!*/ self, [NotNull]MutableString/*!*/ val) {
     var stream = self.GetWritableStream();
     int result = -1;
     self.NonBlockingOperation(() => result = Write(self, val), false);
     return result;
 }
Пример #4
0
        public static int SysWrite(BinaryOpStorage/*!*/ writeStorage, ConversionStorage<MutableString>/*!*/ tosConversion,
            RubyContext/*!*/ context, RubyIO/*!*/ self, [NotNull]MutableString/*!*/ val) {

            RubyBufferedStream stream = self.GetWritableStream();
            if (stream.DataBuffered) {
                PrintOps.ReportWarning(writeStorage, tosConversion, MutableString.CreateAscii("syswrite for buffered IO"));
            }
            int bytes = Write(self, val);
            self.Flush();
            return bytes;
        }
Пример #5
0
 public static int WriteNoBlock(RubyIO/*!*/ self, [NotNull]MutableString/*!*/ val) {
     var stream = self.GetWritableStream();
     try {
         stream.WriteTimeout = 0;
     } catch (InvalidOperationException) {
         throw RubyExceptions.CreateEBADF();
     }
     return Write(self, val);
 }