FSO.Files.Utils.IoBuffer.ReadBytes C# (CSharp) Method

ReadBytes() public method

Reads a number of bytes from the current stream.
public ReadBytes ( int num ) : byte[]
num int Number of bytes to read.
return byte[]
        public byte[] ReadBytes(int num)
        {
            return Reader.ReadBytes(num);
        }

Same methods

IoBuffer::ReadBytes ( uint num ) : byte[]

Usage Example

Example #1
0
 /// <summary>
 /// Reads a SPR2 chunk from a stream.
 /// </summary>
 /// <param name="version">Version of the SPR2 that this frame belongs to.</param>
 /// <param name="stream">A IOBuffer object used to read a SPR2 chunk.</param>
 public void Read(uint version, IoBuffer io, uint guessedSize)
 {
     Version = version;
     if (version == 1001)
     {
         var spriteVersion = io.ReadUInt32();
         var spriteSize = io.ReadUInt32();
         if (IffFile.RETAIN_CHUNK_DATA) ReadDeferred(1001, io);
         else ToDecode = io.ReadBytes(spriteSize);
     } else
     {
         if (IffFile.RETAIN_CHUNK_DATA) ReadDeferred(1000, io);
         else ToDecode = io.ReadBytes(guessedSize);
     }
 }