when length is provided in format, use it; do padding. Fixed signed checking for getInt/Long/Short. Fixed bugs in packing strings: embedded nulls; use length when provided. Logic copied from packing.py. Added special case encoding for 8256 (to match Python and C).