@Override
  public int read() throws IOException {
    final int readResult = in.read();
    if (readResult != -1) {
      return readResult;
    }
    return readNextTailByte();
  }
InputStream that returns all bytes from another stream, then appends the specified 'tail' bytes.
fbcore/src/main/java/com/facebook/common/streams/TailAppendingInputStream.java