claunia / plist-cil

C#/.NET parser for Apple and GnuStep Property List (aka plist), based on Java's dd-plist
Other
54 stars 17 forks source link

Use Stream.WriteByte, and don't allocate a new byte array #60

Closed qmfrederik closed 5 years ago

qmfrederik commented 5 years ago

Stream has a Stream.WriteByte overload, so you don't need to create a new array just to write a single byte. Plus, throwaway arrays like this put pressure on the garbage collector.