private Chunk getChunk(System.IO.Stream inputStream)
        {
            Chunk chunk = new Chunk();

            chunk.setLength(getLong(inputStream));                      // The length of the data chunk.
            chunk.setType(getBytes(inputStream, 4));                    // The chunk type.
            chunk.SetData(getBytes(inputStream, chunk.getLength()));    // The chunk data.
            chunk.setCrc(getLong(inputStream));                         // CRC of the type and data chunks.

            if (!chunk.hasGoodCRC())
            {
                throw new Exception("Chunk has bad CRC.");
            }

            return(chunk);
        }
        private Chunk getChunk( System.IO.Stream inputStream )
        {
            Chunk chunk = new Chunk();

            chunk.setLength( getLong( inputStream ) );              		// The length of the data chunk.
            chunk.setType( getBytes( inputStream, 4 ) );            		// The chunk type.
            chunk.SetData( getBytes( inputStream, chunk.getLength() ) );	// The chunk data.
            chunk.setCrc( getLong( inputStream ) );                 	 	// CRC of the type and data chunks.

            if ( !chunk.hasGoodCRC() ) {
            throw new Exception( "Chunk has bad CRC." );
            }

            return chunk;
        }