import BaseCursor from 'cursor';
import {calculatePadding} from "./util";

export class Cursor extends BaseCursor {

  writeBufferPadded(buffer) {
    let padding = calculatePadding(buffer.length);
    let paddingBuffer = new Buffer(padding);
    paddingBuffer.fill(0);
    
    return this
      .copyFrom(buffer)
      .copyFrom(paddingBuffer);
  }
}
@@ -300,23 +300,35 @@
 opyFrom(
+new Cursor(
 buffer)
+)
 %0A      .
@@ -336,16 +336,27 @@
 opyFrom(
+new Cursor(
 paddingB
@@ -361,15 +361,16 @@
 gBuffer)
+)
 ;%0A  %7D%0A%7D

Fix buffer polyfill type issues: