diff options
Diffstat (limited to 'mcs/class/corlib/System.IO/StreamWriter.cs')
-rw-r--r-- | mcs/class/corlib/System.IO/StreamWriter.cs | 43 |
1 files changed, 8 insertions, 35 deletions
diff --git a/mcs/class/corlib/System.IO/StreamWriter.cs b/mcs/class/corlib/System.IO/StreamWriter.cs index 1799d74e6e6..4c51d0269be 100644 --- a/mcs/class/corlib/System.IO/StreamWriter.cs +++ b/mcs/class/corlib/System.IO/StreamWriter.cs @@ -123,7 +123,7 @@ namespace System.IO { else
mode = FileMode.Create;
- internalStream = new FileStream (path, mode, FileAccess.Write, FileShare.Read);
+ internalStream = new FileStream (path, mode, FileAccess.Write);
if (append)
internalStream.Position = internalStream.Length;
@@ -137,16 +137,12 @@ namespace System.IO { get {
return iflush;
}
- set { - if (DisposedAlready) - throw new ObjectDisposedException("StreamWriter"); - iflush = value; - - if (iflush) { - Flush (); - } - } - } + set {
+ if (DisposedAlready)
+ throw new ObjectDisposedException("StreamWriter");
+ iflush = value;
+ }
+ }
public virtual Stream BaseStream {
get {
@@ -249,28 +245,6 @@ namespace System.IO { index += todo;
decode_pos += todo;
}
- } - - void LowLevelWrite (string s) - { - int count = s.Length; - int index = 0; - while (count > 0) { - int todo = decode_buf.Length - decode_pos; - if (todo == 0) { - Decode (); - todo = decode_buf.Length; - } - if (todo > count) - todo = count; - - for (int i = 0; i < todo; i ++) - decode_buf [i + decode_pos] = s [i + index]; - - count -= todo; - index += todo; - decode_pos += todo; - } }
public override void Write (char value)
@@ -304,8 +278,7 @@ namespace System.IO { throw new ObjectDisposedException("StreamWriter");
if (value != null)
- LowLevelWrite (value); -
+ LowLevelWrite (value.ToCharArray (), 0, value.Length);
if (iflush)
Flush ();
}
|