C# Class Hjg.Pngcs.Chunks.ChunkRaw

Wraps the raw chunk data
Short lived object, to be created while serialing/deserializing Do not reuse it for different chunks See http://www.libpng.org/pub/png/spec/1.2/PNG-Chunks.html
Mostrar archivo Open project: devedse/DeveMazeGenerator Class Usage Examples

Public Properties

Property Type Description
Data byte[]
Id String
IdBytes byte[]
Len int

Public Methods

Method Description
ToString ( ) : String

Just id and length

setOffset ( long offset ) : void

Private Methods

Method Description
AllocData ( ) : void
ChunkRaw ( int length, String idb, bool alloc ) : System

Creates an empty raw chunk

ChunkRaw ( int length, byte idbytes, bool alloc ) : System
ComputeCrc ( ) : int

Called after setting data, before writing to os

GetAsByteStream ( ) : MemoryStream
ReadChunkData ( Stream stream, bool checkCrc ) : int

Position before: just after chunk id. positon after: after crc Data should be already allocated. Checks CRC Return number of byte read.

WriteChunk ( Stream os ) : void

Method Details

ToString() public method

Just id and length
public ToString ( ) : String
return String

setOffset() public method

public setOffset ( long offset ) : void
offset long
return void

Property Details

Data public_oe property

Raw data, crc not included
public byte[] Data
return byte[]

Id public_oe property

public String Id
return String

IdBytes public_oe property

Chunk Id, as array of 4 bytes
public byte[] IdBytes
return byte[]

Len public_oe property

The length counts only the data field, not itself, the chunk type code, or the CRC. Zero is a valid length. Although encoders and decoders should treat the length as unsigned, its value must not exceed 2^31-1 bytes.
public int Len
return int