writeSync method

num writeSync(
  1. Uint8List p
)

Synchronously write the contents of the array buffer (p) to the file.

Returns the number of bytes written.

It is not guaranteed that the full buffer will be written in a single call.

const encoder = new TextEncoder();
const data = encoder.encode("Hello world");
const file = Deno.openSync("/foo/bar.txt", { write: true });
const bytesWritten = file.writeSync(data); // 11
file.close();

Implementation

_i2.num writeSync(_i9.Uint8List p) => _i3.callMethod(
      this,
      'writeSync',
      [p],
    );