com.fsck.k9.mail.Message.getSize()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(252)

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

Message.getSize介绍

暂无

代码示例

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

private Message buildSmallNewMessage() {
  Message message = mock(Message.class);
  when(message.olderThan(nullable(Date.class))).thenReturn(false);
  when(message.getSize()).thenReturn((long) MAXIMUM_SMALL_MESSAGE_SIZE);
  return message;
}

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

private Message buildLargeNewMessage() {
  Message message = mock(Message.class);
  when(message.olderThan(nullable(Date.class))).thenReturn(false);
  when(message.getSize()).thenReturn((long) (MAXIMUM_SMALL_MESSAGE_SIZE + 1));
  return message;
}

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

int unsizedMessages = 0;
for (Message message : messages) {
  if (message.getSize() == -1) {
    unsizedMessages++;

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

ByteArrayOutputStream out;
long size = message.getSize();
if (size > Integer.MAX_VALUE) {
  throw new MessagingException("message size > Integer.MAX_VALUE!");

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

@Override
public void messageFinished(T message, int number, int ofTotal) {
  try {
    if (message.isSet(Flag.DELETED) || message.olderThan(earliestDate)) {
      if (message.isSet(Flag.DELETED)) {
        Timber.v("Newly downloaded message %s:%s:%s was marked deleted on server, " +
            "skipping", accountName, folder, message.getUid());
      } else {
        Timber.d("Newly downloaded message %s is older than %s, skipping",
            message.getUid(), earliestDate);
      }
      progress.incrementAndGet();
      //TODO: This might be the source of poll count errors in the UI. Is todo always the same as ofTotal
      listener.syncProgress(folder, progress.get(), todo);
      return;
    }
    if (syncConfig.getMaximumAutoDownloadMessageSize() > 0 &&
        message.getSize() > syncConfig.getMaximumAutoDownloadMessageSize()) {
      largeMessages.add(message);
    } else {
      smallMessages.add(message);
    }
  } catch (Exception e) {
    Timber.e(e, "Error while storing downloaded message.");
  }
}

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

@Override
public void messageFinished(T message, int number, int ofTotal) {
  try {
    if (message.isSet(Flag.DELETED) || message.olderThan(earliestDate)) {
      if (message.isSet(Flag.DELETED)) {
        Timber.v("Newly downloaded message %s:%s:%s was marked deleted on server, " +
            "skipping", accountName, folder, message.getUid());
      } else {
        Timber.d("Newly downloaded message %s is older than %s, skipping",
            message.getUid(), earliestDate);
      }
      progress.incrementAndGet();
      //TODO: This might be the source of poll count errors in the UI. Is todo always the same as ofTotal
      listener.syncProgress(folder, progress.get(), todo);
      return;
    }
    if (syncConfig.getMaximumAutoDownloadMessageSize() > 0 &&
        message.getSize() > syncConfig.getMaximumAutoDownloadMessageSize()) {
      largeMessages.add(message);
    } else {
      smallMessages.add(message);
    }
  } catch (Exception e) {
    Timber.e(e, "Error while storing downloaded message.");
  }
}

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

@Override
public void messageFinished(T message, int number, int ofTotal) {
  try {
    if (message.isSet(Flag.DELETED) || message.olderThan(earliestDate)) {
      if (message.isSet(Flag.DELETED)) {
        Timber.v("Newly downloaded message %s:%s:%s was marked deleted on server, " +
            "skipping", accountName, folder, message.getUid());
      } else {
        Timber.d("Newly downloaded message %s is older than %s, skipping",
            message.getUid(), earliestDate);
      }
      progress.incrementAndGet();
      //TODO: This might be the source of poll count errors in the UI. Is todo always the same as ofTotal
      listener.syncProgress(folder, progress.get(), todo);
      return;
    }
    if (syncConfig.getMaximumAutoDownloadMessageSize() > 0 &&
        message.getSize() > syncConfig.getMaximumAutoDownloadMessageSize()) {
      largeMessages.add(message);
    } else {
      smallMessages.add(message);
    }
  } catch (Exception e) {
    Timber.e(e, "Error while storing downloaded message.");
  }
}

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

|| message.getSize() < syncConfig.getMaximumAutoDownloadMessageSize()) {
completeMessage = true;

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

|| message.getSize() < syncConfig.getMaximumAutoDownloadMessageSize()) {
completeMessage = true;

相关文章