Added read(byte[] buf, int offset) method to serialization