Engines/FlatRedBallXNA/FlatRedBall/IO/PngLoader.cs
/// <summary>
/// Reads the bytes of a chunk's ChunkData segment from the Stream and returns it in a
/// byte[].
/// </summary>
/// <param name="file">A Stream pointing to the .png image's data.</param>
/// <param name="length">The given length of the ChunkData (Should be the value provided by the Chunk).</param>
/// <returns>A byte[] containing ChunkData from the Stream</returns>
Reads the bytes of a chunk's ChunkData segment from the Stream and returns it in a
byte[].
Reads the bytes of a chunk ' s ChunkData segment from the Stream and returns it in a byte [] .
private static byte[] GetChunkData(ref Stream file, uint length)
        {
            byte[] data = new byte[length];
            for (int i = 0; i < length; ++i)
            {
                data[i] = (byte)file.ReadByte();
            }
            return data;
        }
private static byte [ ] GetChunkData ( ref Stream file , uint length ) { byte [ ] data = new byte [ length ] ; for ( int i = 0 ; i < length ; ++ i ) { data [ i ] = ( byte ) file . ReadByte ( ) ; } return data ; }
Reads the bytes of a chunk's ChunkData segment from the Stream and returns it in a
byte[].
Reads the bytes of a chunk ' s ChunkData segment from the Stream and returns it in a byte [] .
//Read length-number of bytes into a byte[] and return it
A byte[] containing ChunkData from the Stream
A byte [] containing ChunkData from the Stream
Stream
ref
length
uint
The given length of the ChunkData (Should be the value provided by the Chunk).
The given length of the ChunkData ( Should be the value provided by the Chunk ) .
file
A Stream pointing to the .png image's data.
A Stream pointing to the . png image ' s data .