gpt4 book ai didi

com.jcraft.jzlib.ZOutputStream.setFlushMode()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 04:04:49 32 4
gpt4 key购买 nike

本文整理了Java中com.jcraft.jzlib.ZOutputStream.setFlushMode()方法的一些代码示例,展示了ZOutputStream.setFlushMode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZOutputStream.setFlushMode()方法的具体详情如下:
包路径:com.jcraft.jzlib.ZOutputStream
类名称:ZOutputStream
方法名:setFlushMode

ZOutputStream.setFlushMode介绍

暂无

代码示例

代码示例来源:origin: igniterealtime/Openfire

@Override
public void startCompression() {
  compressed = true;
  try {
    if (tlsStreamHandler == null) {
      ZOutputStream out = new ZOutputStream(
          ServerTrafficCounter.wrapOutputStream(socket.getOutputStream()),
          JZlib.Z_BEST_COMPRESSION);
      out.setFlushMode(JZlib.Z_PARTIAL_FLUSH);
      writer = new BufferedWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8));
      xmlSerializer = new XMLSocketWriter(writer, this);
    }
    else {
      ZOutputStream out = new ZOutputStream(tlsStreamHandler.getOutputStream(), JZlib.Z_BEST_COMPRESSION);
      out.setFlushMode(JZlib.Z_PARTIAL_FLUSH);
      writer = new BufferedWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8));
      xmlSerializer = new XMLSocketWriter(writer, this);
    }
  } catch (IOException e) {
    // TODO Would be nice to still be able to throw the exception and not catch it here
    Log.error("Error while starting compression", e);
    compressed = false;
  }
}

代码示例来源:origin: k9mail/k-9

private void enableCompression(Socket socket) throws IOException {
  InputStream inputStream = new InflaterInputStream(socket.getInputStream(), new Inflater(true));
  input = Okio.buffer(Okio.source(inputStream));
  ZOutputStream outputStream = new ZOutputStream(socket.getOutputStream(), JZlib.Z_BEST_SPEED, true);
  outputStream.setFlushMode(JZlib.Z_PARTIAL_FLUSH);
  output = Okio.buffer(Okio.sink(outputStream));
}

代码示例来源:origin: k9mail/k-9

private void enableCompression(Socket socket) throws IOException {
  InputStream inputStream = new InflaterInputStream(socket.getInputStream(), new Inflater(true));
  input = Okio.buffer(Okio.source(inputStream));
  ZOutputStream outputStream = new ZOutputStream(socket.getOutputStream(), JZlib.Z_BEST_SPEED, true);
  outputStream.setFlushMode(JZlib.Z_PARTIAL_FLUSH);
  output = Okio.buffer(Okio.sink(outputStream));
}

代码示例来源:origin: k9mail/k-9

private void enableCompression(Socket socket) throws IOException {
  InputStream inputStream = new InflaterInputStream(socket.getInputStream(), new Inflater(true));
  input = Okio.buffer(Okio.source(inputStream));
  ZOutputStream outputStream = new ZOutputStream(socket.getOutputStream(), JZlib.Z_BEST_SPEED, true);
  outputStream.setFlushMode(JZlib.Z_PARTIAL_FLUSH);
  output = Okio.buffer(Okio.sink(outputStream));
}

代码示例来源:origin: k9mail/k-9

private void enableCompression() throws IOException, MessagingException {
  try {
    executeSimpleCommand(Commands.COMPRESS_DEFLATE);
  } catch (NegativeImapResponseException e) {
    Timber.d(e, "Unable to negotiate compression: ");
    return;
  }
  try {
    InflaterInputStream input = new InflaterInputStream(socket.getInputStream(), new Inflater(true));
    ZOutputStream output = new ZOutputStream(socket.getOutputStream(), JZlib.Z_BEST_SPEED, true);
    output.setFlushMode(JZlib.Z_PARTIAL_FLUSH);
    setUpStreamsAndParser(input, output);
    if (K9MailLib.isDebug()) {
      Timber.i("Compression enabled for %s", getLogId());
    }
  } catch (IOException e) {
    close();
    Timber.e(e, "Error enabling compression");
  }
}

代码示例来源:origin: org.igniterealtime.openfire/xmppserver

@Override
public void startCompression() {
  compressed = true;
  try {
    if (tlsStreamHandler == null) {
      ZOutputStream out = new ZOutputStream(
          ServerTrafficCounter.wrapOutputStream(socket.getOutputStream()),
          JZlib.Z_BEST_COMPRESSION);
      out.setFlushMode(JZlib.Z_PARTIAL_FLUSH);
      writer = new BufferedWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8));
      xmlSerializer = new XMLSocketWriter(writer, this);
    }
    else {
      ZOutputStream out = new ZOutputStream(tlsStreamHandler.getOutputStream(), JZlib.Z_BEST_COMPRESSION);
      out.setFlushMode(JZlib.Z_PARTIAL_FLUSH);
      writer = new BufferedWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8));
      xmlSerializer = new XMLSocketWriter(writer, this);
    }
  } catch (IOException e) {
    // TODO Would be nice to still be able to throw the exception and not catch it here
    Log.error("Error while starting compression", e);
    compressed = false;
  }
}

代码示例来源:origin: google/sagetv

zout.setFlushMode(com.jcraft.jzlib.JZlib.Z_SYNC_FLUSH);

代码示例来源:origin: google/sagetv

sendSetProperty("ZLIB_COMM_XFER", "TRUE");
zout = new com.jcraft.jzlib.ZOutputStream(clientSocket.socket().getOutputStream(), 5/*halfway between best speed & best compression*/, true);
zout.setFlushMode(com.jcraft.jzlib.JZlib.Z_SYNC_FLUSH);

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com