(s string)
| 108 | } |
| 109 | |
| 110 | func (amf *AMF3) writeString(s string) error { |
| 111 | index, ok := amf.scEnc[s] |
| 112 | if ok { |
| 113 | amf.writeU29(uint32(index << 1)) |
| 114 | return nil |
| 115 | } |
| 116 | |
| 117 | err := amf.writeU29(uint32((len(s) << 1) | 0x01)) |
| 118 | if err != nil { |
| 119 | return err |
| 120 | } |
| 121 | |
| 122 | if s != "" { |
| 123 | amf.scEnc[s] = len(amf.scEnc) |
| 124 | } |
| 125 | amf.WriteString(s) |
| 126 | return nil |
| 127 | } |
| 128 | |
| 129 | func (amf *AMF3) readU29() (uint32, error) { |
| 130 | var ret uint32 = 0 |
no test coverage detected