C# Класс 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
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Data byte[]
Id String
IdBytes byte[]
Len int

Открытые методы

Метод Описание
ToString ( ) : String

Just id and length

setOffset ( long offset ) : void

Приватные методы

Метод Описание
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

Описание методов

ToString() публичный Метод

Just id and length
public ToString ( ) : String
Результат String

setOffset() публичный Метод

public setOffset ( long offset ) : void
offset long
Результат void

Описание свойств

Data публичное свойство

Raw data, crc not included
public byte[] Data
Результат byte[]

Id публичное свойство

public String Id
Результат String

IdBytes публичное свойство

Chunk Id, as array of 4 bytes
public byte[] IdBytes
Результат byte[]

Len публичное свойство

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
Результат int