void JSocketHandler::connect(){ if (port == 0) { throw new JIllegalArgumentException("Bad port: 0"); } if (host == NULL) { throw new JIllegalArgumentException("Null host name: "); } sock = new JSocket(*host, port); JOutputStream* out = sock->getOutputStream(); JBufferedOutputStream* bout = new JBufferedOutputStream(out); setOutputStream(bout); }
JSONStringer::JSONStringer() : JSONWriter(), _oss(std::make_unique<asciistream>()) { setOutputStream(*_oss); }