Esempio n. 1
0
  public void write(String str) {
    synchronized (this) {
      if (isClosed()) return;

      buffer().write(str, StringCodec.utf_8());
    }
  }
Esempio n. 2
0
  public void writeOut(String prompt) {
    IBuffer out;
    synchronized (this) {
      if (isClosed()) return;

      m_closed = true;

      out = detachBuffer();
      if (!out.isEmpty() && !out.endsWith(CR) && !out.endsWith(LF)) {
        out.write(CR[0]);
        out.write(LF[0]);
      }

      if (!prompt.isEmpty()) out.write(prompt, StringCodec.utf_8());

      if (!out.isEmpty()) prependLength(out);

      // EOF
      out.write((byte) 0);
      out.write(0, IntCodec.bigEndian());
    }

    m_ss.write(m_session, out);
  }