71
72
public writeSize(): number {
74
>
+ 4 // oldPosition
75
>
+ 4 // newPosition
76
>
+ TextChange._writeStringSize(this.oldText)
77
>
+ TextChange._writeStringSize(this.newText)
78
>
);
79
>
}
80
81
public write(b: Uint8Array, offset: number): number {
82
>
buffer.writeUInt32BE(b, this.oldPosition, offset); offset += 4;
textChange.ts
83
>
buffer.writeUInt32BE(b, this.newPosition, offset); offset += 4;
84
>
offset = TextChange._writeString(b, this.oldText, offset);
85
>
offset = TextChange._writeString(b, this.newText, offset);
86
>
return offset;
87
>
}
88
89
public static read(b: Uint8Array, offset: number, dest: TextChange[]): number {