private int readNextTailByte() {
    if (mTailOffset >= mTail.length) {
      return -1;
    }
    return ((int) mTail[mTailOffset++]) & 0xFF;
  }
InputStream that returns all bytes from another stream, then appends the specified 'tail' bytes.
fbcore/src/main/java/com/facebook/common/streams/TailAppendingInputStream.java