(buffer: Uint8Array)
| 305 | } |
| 306 | |
| 307 | private writeAllChunk(buffer: Uint8Array): Effect.Effect<void, PlatformError.PlatformError> { |
| 308 | return Effect.flatMap(this.writeChunk("writeAll", buffer), (bytesWritten) => { |
| 309 | if (bytesWritten === BigInt(0)) { |
| 310 | return Effect.fail(PlatformError.systemError({ |
| 311 | module: "FileSystem", |
| 312 | method: "writeAll", |
| 313 | _tag: "WriteZero", |
| 314 | description: "write returned 0 bytes written" |
| 315 | })) |
| 316 | } |
| 317 | return bytesWritten < buffer.length |
| 318 | ? this.writeAllChunk(buffer.subarray(Number(bytesWritten))) |
| 319 | : Effect.void |
| 320 | }) |
| 321 | } |
| 322 | |
| 323 | writeAll(buffer: Uint8Array) { |
| 324 | return buffer.length === 0 ? Effect.void : this.writeAllChunk(buffer) |
no test coverage detected