[fix] unpack could be a buffer, not only a stream