* Encoders/decoders to read from current offset in a file handle and * encode/decode the data according to argument types. */
| 1650 | * encode/decode the data according to argument types. |
| 1651 | */ |
| 1652 | inline ssize_t decode_file(int fd, std::string &str) |
| 1653 | { |
| 1654 | bufferlist bl; |
| 1655 | __u32 len = 0; |
| 1656 | bl.read_fd(fd, sizeof(len)); |
| 1657 | decode(len, bl); |
| 1658 | bl.read_fd(fd, len); |
| 1659 | decode(str, bl); |
| 1660 | return bl.length(); |
| 1661 | } |
| 1662 | |
| 1663 | inline ssize_t decode_file(int fd, bufferptr &bp) |
| 1664 | { |