(data []byte)
| 202 | } |
| 203 | |
| 204 | func (this *FileWriter) write(data []byte) (n int, err error) { |
| 205 | n, err = this.rawWriter.Write(data) |
| 206 | this.bodySize += int64(n) |
| 207 | |
| 208 | if this.maxSize > 0 && this.bodySize > this.maxSize { |
| 209 | err = ErrEntityTooLarge |
| 210 | |
| 211 | if this.storage != nil { |
| 212 | this.storage.IgnoreKey(this.key, this.maxSize) |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | if err != nil { |
| 217 | _ = this.Discard() |
| 218 | } |
| 219 | |
| 220 | return |
| 221 | } |