(ctx context.Context)
| 465 | } |
| 466 | |
| 467 | func (p *TBinaryProtocol) ReadString(ctx context.Context) (value string, err error) { |
| 468 | size, e := p.ReadI32(ctx) |
| 469 | if e != nil { |
| 470 | return "", e |
| 471 | } |
| 472 | err = checkSizeForProtocol(size, p.cfg) |
| 473 | if err != nil { |
| 474 | return |
| 475 | } |
| 476 | if size == 0 { |
| 477 | return "", nil |
| 478 | } |
| 479 | if size < int32(len(p.buffer)) { |
| 480 | // Avoid allocation on small reads |
| 481 | buf := p.buffer[:size] |
| 482 | read, e := io.ReadFull(p.trans, buf) |
| 483 | return string(buf[:read]), NewTProtocolException(e) |
| 484 | } |
| 485 | |
| 486 | return p.readStringBody(size) |
| 487 | } |
| 488 | |
| 489 | func (p *TBinaryProtocol) ReadBinary(ctx context.Context) ([]byte, error) { |
| 490 | size, e := p.ReadI32(ctx) |
no test coverage detected