System.IO.Stream.Read C# (CSharp) Méthode

Read() public abstract méthode

public abstract Read ( [ buffer, int offset, int count ) : int
buffer [
offset int
count int
Résultat int
        public abstract int Read([In, Out] byte[] buffer, int offset, int count);

Usage Example

Exemple #1
0
		public OggTag Read( Stream oggStream )
		{
			OggTag tag = new OggTag();
			
			byte[] b = new byte[4];
			oggStream.Read( b , 0,  b .Length);
			int vendorstringLength = Utils.GetNumber( b, 0, 3);
			b = new byte[vendorstringLength];
			oggStream.Read( b , 0,  b .Length);
			tag.Add("vendor", new string(Encoding.UTF8.GetChars(b)));
			
			b = new byte[4];
			oggStream.Read( b , 0,  b .Length);
			int userComments = Utils.GetNumber( b, 0, 3);

			for ( int i = 0; i < userComments; i++ ) {
				b = new byte[4];
				oggStream.Read( b , 0,  b .Length);
				int commentLength = Utils.GetNumber( b, 0, 3);

				b = new byte[commentLength];
				oggStream.Read( b , 0,  b .Length);
				tag.AddOggField(b);
			}
			
			return tag;
		}
All Usage Examples Of System.IO.Stream::Read