IsEndOfStream() public method

public IsEndOfStream ( ) : bool
return bool
Esempio n. 1
0
        public static MutableString /*!*/ Read(RubyIO /*!*/ self, [DefaultProtocol] int bytes, [DefaultProtocol, Optional] MutableString buffer)
        {
            self.AssertOpenedForReading();
            if (self.IsEndOfStream())
            {
                return(null);
            }

            if (buffer == null)
            {
                buffer = MutableString.CreateBinary();
            }

            buffer.Clear();
            if (!self.PreserveEndOfLines)
            {
                for (int i = 0; i < bytes; ++i)
                {
                    int c = self.ReadByteNormalizeEoln();
                    if (c == -1)
                    {
                        return(buffer);
                    }
                    else
                    {
                        buffer.Append((byte)c);
                    }
                }
            }
            else
            {
                var fixedBuffer = new byte[bytes];
                bytes = self.ReadBytes(fixedBuffer, 0, bytes);
                buffer.Append(fixedBuffer, 0, bytes);
            }

            return(buffer);
        }
Esempio n. 2
0
 public static bool Eof(RubyIO/*!*/ self) {
     self.RequireReadable();
     return self.IsEndOfStream();
 }
Esempio n. 3
0
        public static MutableString/*!*/ Read(RubyIO/*!*/ self, [DefaultProtocol]int bytes, [DefaultProtocol, Optional]MutableString buffer) {
            self.AssertOpenedForReading();
            if (self.IsEndOfStream()) {
                return null;
            }

            if (buffer == null) {
                buffer = MutableString.CreateBinary();
            }

            buffer.Clear();
            if (!self.PreserveEndOfLines) {
                for (int i = 0; i < bytes; ++i) {
                    int c = self.ReadByteNormalizeEoln();
                    if (c == -1) {
                        return buffer;
                    } else {
                        buffer.Append((byte)c);
                    }
                }
            } else {
                var fixedBuffer = new byte[bytes];
                bytes = self.ReadBytes(fixedBuffer, 0, bytes);
                buffer.Append(fixedBuffer, 0, bytes);
            }

            return buffer;
        }
Esempio n. 4
0
 public static bool Eof(RubyIO/*!*/ self) {
     self.AssertOpenedForReading();
     return self.IsEndOfStream();
 }
Esempio n. 5
0
 public static bool Eof(RubyIO /*!*/ self)
 {
     self.AssertOpenedForReading();
     return(self.IsEndOfStream());
 }
Esempio n. 6
0
 public static bool Eof(RubyIO /*!*/ self)
 {
     self.RequireReadable();
     return(self.IsEndOfStream());
 }