One COS object: a value exactly as a PDF file stores it. The hierarchy is closed; every object is one of CosBoolean, CosInteger, CosReal, CosString, CosName, CosArray, CosDictionary, CosStream, CosNull or CosReference.
public abstract class CosObject
ISO 32000-2 §7.3.
Mutability. Booleans, numbers, strings, names, null and references are immutable values. Arrays, dictionaries and streams are mutable containers.
Dirty tracking. IsDirty is false for every object a parser produces and for every newly
constructed object, and becomes true once the object, or any direct object it contains, is changed through the
public API. Immutable objects are never dirty; replacing one inside a container makes the container dirty. Indirect references
are not followed: a change to the object a CosReference points to does not make the referring container dirty.
Equality. Equals(Object?) is value equality for the immutable objects and reference identity for the mutable containers, so a container is safe as a hash key while it changes. DeepEquals(CosObject?, CosObject?) compares structure, and is the equality a serialize-then-parse round trip preserves.
kind:method, kind:property, kind:ctor. Press Esc to clear.IsDirtyGets a value indicating whether this object, or a direct object it contains, has been changed through the public API since it was parsed or constructed. Always false for immutable objects.DeepEquals(CosObject?, CosObject?)Compares two objects by structure: the same kind of object with the same value, recursively for containers.Parse(ReadOnlySpan<Byte>)Parses exactly one COS object from bytes.ToString()Returns this object's PDF syntax, as WriteTo(IBufferWriter<Byte>) writes it, with each byte shown as its Latin-1 character.TryParse(ReadOnlySpan<Byte>, out CosObject?)Tries to parse exactly one COS object from bytes, under the same rules as Parse(ReadOnlySpan<Byte>).WriteTo(IBufferWriter<Byte>)Writes this object's PDF syntax to writer.