Add replace method
Complete class OctetsStream