src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts/PieceTreeBase/_getCharCode
class PieceTreeBase:	private _getCharCode(nodePos: NodePosition): number {
		if (nodePos.remainder === nodePos.node.piece.length) {
			// the char we want to fetch is at the head of next node.
			const matchingNode = nodePos.node.next();
			if (!matchingNode) {
				return 0;
			}

			const buffer = this._buffers[matchingNode.piece.bufferIndex];
			const startOffset = this.offsetInBuffer(matchingNode.piece.bufferIndex, matchingNode.piece.start);
			return buffer.buffer.charCodeAt(startOffset);
		} else {
			const buffer = this._buffers[nodePos.node.piece.bufferIndex];
			const startOffset = this.offsetInBuffer(nodePos.node.piece.bufferIndex, nodePos.node.piece.start);
			const targetOffset = startOffset + nodePos.remainder;

			return buffer.buffer.charCodeAt(targetOffset);
		}
	}