code: @Override
     public void writeStdin(ByteBuffer buffer)
     {
        try {
           int fd = stdin.acquire();
           boolean closing = stdinClosing.get();
           if (fd != -1 && !closing) {
              pendingWrites.add(buffer);
              myProcessor.queueWrite(this);
           }
           else {
              throw new IllegalStateException("closeStdin() method has already been called.");
           }
        } finally {
           stdin.release();
        }
     }
docs: {@inheritDoc}