Use LockObj for Stream Write