()
| 63 | } |
| 64 | |
| 65 | public readAll(): Uint8Array { |
| 66 | const all: ByteBuffer = ByteBuffer.empty(); |
| 67 | try { |
| 68 | while (true) { |
| 69 | all.writeByte(this.readByte() & 0xff); |
| 70 | } |
| 71 | } catch (e) { |
| 72 | if (!(e instanceof EndOfReaderError)) { |
| 73 | throw e; |
| 74 | } |
| 75 | } |
| 76 | return all.toArray(); |
| 77 | } |
| 78 | } |