[feat] new pngchunk encode/decoderr

This commit is contained in:
kwaroran
2024-01-03 04:13:19 +09:00
parent 239d819383
commit a8e50dcd77
10 changed files with 196 additions and 24 deletions

View File

@@ -1195,7 +1195,7 @@ export class LocalWriter{
this.writer = writableStream.getWriter()
return true
}
async write(name:string,data: Uint8Array){
async writeBackup(name:string,data: Uint8Array){
const encodedName = new TextEncoder().encode(getBasename(name))
const nameLength = new Uint32Array([encodedName.byteLength])
await this.writer.write(new Uint8Array(nameLength.buffer))
@@ -1204,6 +1204,9 @@ export class LocalWriter{
await this.writer.write(new Uint8Array(dataLength.buffer))
await this.writer.write(data)
}
async write(data:Uint8Array) {
await this.writer.write(data)
}
async close(){
await this.writer.close()
}