Use latest ReadAll helper function

This commit is contained in:
2018-12-12 12:40:28 +09:00
parent 616f27e363
commit 7b07dc29bc
2 changed files with 2 additions and 11 deletions

View File

@ -36,15 +36,5 @@ func Subtitles(ctx *aero.Context) string {
}
defer obj.Close()
data := make([]byte, 0, 65535)
buffer := make([]byte, 4096)
n := 0
for err == nil {
n, err = obj.Read(buffer)
data = append(data, buffer[:n]...)
}
return string(data)
return ctx.ReadAll(obj)
}