Writes a subarray of characters to the stream. : Stream « File Stream « C# / C Sharp

Home
C# / C Sharp
1.2D Graphics
2.Class Interface
3.Collections Data Structure
4.Components
5.Data Types
6.Database ADO.net
7.Date Time
8.Design Patterns
9.Development Class
10.Event
11.File Stream
12.Generics
13.GUI Windows Form
14.Internationalization I18N
15.Language Basics
16.LINQ
17.Network
18.Office
19.Reflection
20.Regular Expressions
21.Security
22.Services Event
23.Thread
24.Web Services
25.Windows
26.Windows Presentation Foundation
27.XML
28.XML LINQ
C# / C Sharp » File Stream » Stream 




Writes a subarray of characters to the stream.
   


using System;
using System.IO;

public class SWBuff 
{
    public static void Main(String[] args)
    {
        FileStream sb = new FileStream("MyFile.txt", FileMode.OpenOrCreate);
        char[] b = {'a','b','c','d','e','f','g','h','i','j','k','l','m'};
        StreamWriter sw = new StreamWriter(sb);
        sw.Write(b, 38);
        sw.Close();
    }
}

   
    
    
  














Related examples in the same category
1.Stream.CanRead indicates whether the current stream supports reading.
2.Stream.CanWrite Property indicates whether the current stream supports writing.
3.Stream.CopyTo reads all the bytes from the current stream and writes them to the destination stream.
4.Stream.Read reads a sequence of bytes and advances the position
5.Create StreamWriter class for the specified stream, using the specified encoding and the default buffer size.
6.Create StreamWriter from FileStream
7.Create StreamWriter with encoding
8.Create StreamWriter from file name
9.UTF8 encoding StreamWriter
10.Create UTF8 encoding StreamWriter from File name
11.Set StreamWriter buffer size
12.Create a new instance of the StreamReader class for the specified stream.
13.Gets the current character encoding that the current StreamReader object is using.
14.Returns the next available character but does not consume it.
15.Reads a maximum of count characters from the current stream into buffer, beginning at index.
16.Reads the next character from the input stream and advances the character position by one character.
17.Read a single character
18.Reads a line of characters from the current stream and returns the data as a string.
19.Reads the stream from the current position to the end of the stream.
20.Copy Stream
21.Copy one Stream to another Stream
22.Authentication Stream
23.Outputs data from a read stream to a newly created file
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.