ENH: Add file buffer validation to I/O ops
State: closed

1) Allows for more uniform handling of invalid file buffers to our `read_*` functions.
2) Adds a ton of new documentation to `inference.py`

Closes #15337.

Partially addresses #15895.

Labels:
name: IO CSV
description: read_csv, to_csv
name: Compat
description: pandas objects compatability with Numpy or Python functions

Comments:
lgtm.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15894?src=pr&el=h1) Report
> Merging [#15894](https://codecov.io/gh/pandas-dev/pandas/pull/15894?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/0a3706780feb77f241715ffcdebb14ad7d678d3d?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `95.12%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/15894/graphs/tree.svg?height=150&token=eZ4WkYLtcO&width=650&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/15894?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #15894      +/-   ##
==========================================
- Coverage   90.97%   90.97%   -0.01%     
==========================================
  Files         145      145              
  Lines       49496    49518      +22     
==========================================
+ Hits        45027    45047      +20     
- Misses       4469     4471       +2
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.73% <95.12%> (ø)` | :arrow_up: |
| #single | `40.64% <75.6%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/15894?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/types/api.py](https://codecov.io/gh/pandas-dev/pandas/pull/15894?src=pr&el=tree#diff-cGFuZGFzL3R5cGVzL2FwaS5weQ==) | `100% <ø> (ø)` | :arrow_up: |
| [pandas/io/excel.py](https://codecov.io/gh/pandas-dev/pandas/pull/15894?src=pr&el=tree#diff-cGFuZGFzL2lvL2V4Y2VsLnB5) | `79.73% <100%> (+0.03%)` | :arrow_up: |
| [pandas/io/common.py](https://codecov.io/gh/pandas-dev/pandas/pull/15894?src=pr&el=tree#diff-cGFuZGFzL2lvL2NvbW1vbi5weQ==) | `70.08% <90.9%> (+0.75%)` | :arrow_up: |
| [pandas/types/inference.py](https://codecov.io/gh/pandas-dev/pandas/pull/15894?src=pr&el=tree#diff-cGFuZGFzL3R5cGVzL2luZmVyZW5jZS5weQ==) | `98.3% <96.42%> (-1.7%)` | :arrow_down: |
| [pandas/io/packers.py](https://codecov.io/gh/pandas-dev/pandas/pull/15894?src=pr&el=tree#diff-cGFuZGFzL2lvL3BhY2tlcnMucHk=) | `88.19% <0%> (-0.32%)` | :arrow_down: |
| [pandas/core/common.py](https://codecov.io/gh/pandas-dev/pandas/pull/15894?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29tbW9uLnB5) | `91.03% <0%> (+0.34%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15894?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15894?src=pr&el=footer). Last update [0a37067...5a8f8da](https://codecov.io/gh/pandas-dev/pandas/pull/15894?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
@jreback : Everything is green and ready to go.
@jreback , @jorisvandenbossche : Everything is green and ready to go.
thanks!