code: private void flushData() {
      byte[] data = Arrays.copyOf(pendingBuffer, pendingLength);
      pendingLength = 0;
      handler.onData(data);
    }
docs: Flush the {@link #pendingBuffer} buffer to {@link TelnetHandler#onData(byte[])}.