()
| 38 | } |
| 39 | |
| 40 | func (amf *AMF3) readString() (string, error) { |
| 41 | index, err := amf.readU29() |
| 42 | if err != nil { |
| 43 | return "", err |
| 44 | } |
| 45 | ret := "" |
| 46 | if (index & 0x01) == 0 { |
| 47 | ret = amf.scDec[int(index>>1)] |
| 48 | } else { |
| 49 | index >>= 1 |
| 50 | ret = string(amf.ReadN(int(index))) |
| 51 | } |
| 52 | if ret != "" { |
| 53 | amf.scDec = append(amf.scDec, ret) |
| 54 | } |
| 55 | return ret, nil |
| 56 | } |
| 57 | func (amf *AMF3) Unmarshal() (obj any, err error) { |
| 58 | defer func() { |
| 59 | if e := recover(); e != nil { |