javax.mail.util.SharedByteArrayInputStream.close()方法的使用及代码示例

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

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

SharedByteArrayInputStream.close介绍

暂无

代码示例

代码示例来源:origin: camunda/camunda-bpm-platform

new SharedByteArrayInputStream(bos.toByteArray());
  parse(bis);
  bis.close();
  saved = true;
} catch (IOException ex) {

代码示例来源:origin: com.sun.mail/javax.mail

new SharedByteArrayInputStream(bos.toByteArray());
  parse(bis);
  bis.close();
  saved = true;
} catch (IOException ex) {

代码示例来源:origin: stackoverflow.com

SharedByteArrayInputStream stream = (SharedByteArrayInputStream) content;
ByteArrayOutputStream bOut = new ByteArrayOutputStream();

//Reading in chunks is better performance-wise than reading one byte at once.
int r;
byte[] buffer = new byte[32 * 1000];

//Read and write into the ByteArrayOutputStream
while((r = stream.read(buffer) != -1){
  bOut.write(buffer, 0, r);
}

String aloha = new String(bOut.toByteArray(), Charset.forName( "ISO-8859-1" ));
writer.append(aloha+"\n");
stream.close();

代码示例来源:origin: stackoverflow.com

FileOutputStream fileOutputStream = new FileOutputStream(filepath);
SharedByteArrayInputStream stream = (SharedByteArrayInputStream) content;
byte bite = 0;
byte[] buffer = new byte[1024];
//here we're reading more than one byte at a time.
while((bite=(byte) stream.read(buffer))!=-1){
  //write to file output stream instead.
  fileOutputStream.write(buffer,0,bite);
  //don't append new line character.
}
stream.close();
//close the output stream if you're done.
fileOutputStream.close();

代码示例来源:origin: stackoverflow.com

// Get the message object from the folder in the
// usual way, for example:
MimeMessage msg = (MimeMessage)folder.getMessage(n);

// Copy the message by writing into an byte array and
// creating a new MimeMessage object based on the contents
// of the byte array:
ByteArrayOutputStream bos = new ByteArrayOutputStream();
msg.writeTo(bos);
bos.close();
SharedByteArrayInputStream bis =
    new SharedByteArrayInputStream(bos.toByteArray());
MimeMessage cmsg = new MimeMessage(session, bis);
bis.close();

// The cmsg object is disconnected from the server so
// setFlags will have no effect (for example).  Use
// the original msg object for such operations.  Use
// the cmsg object to access the content of the message.

代码示例来源:origin: org.apache.james/james-server-queue-jms

@Override
public void dispose() {
  try {
    in.close();
  } catch (IOException e) {
    //ignore exception during close
  }
  LifecycleUtil.dispose(in);
  try {
    message.clearBody();
  } catch (JMSException e) {
    LOGGER.error("Error clearing JMS message body", e);
  }
  try {
    message.clearProperties();
  } catch (JMSException e) {
    LOGGER.error("Error clearing JMS message properties", e);
  }
  content = null;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.javax.mail

new SharedByteArrayInputStream(bos.toByteArray());
  parse(bis);
  bis.close();
  saved = true;
} catch (IOException ex) {

代码示例来源:origin: javax.mail/com.springsource.javax.mail

new SharedByteArrayInputStream(bos.toByteArray());
  parse(bis);
  bis.close();
  saved = true;
} catch (IOException ex) {

代码示例来源:origin: com.sun.mail/jakarta.mail

new SharedByteArrayInputStream(bos.toByteArray());
  parse(bis);
  bis.close();
  saved = true;
} catch (IOException ex) {

代码示例来源:origin: com.sun.mail/mailapi

new SharedByteArrayInputStream(bos.toByteArray());
  parse(bis);
  bis.close();
  saved = true;
} catch (IOException ex) {

代码示例来源:origin: jboss/jboss-javaee-specs

new SharedByteArrayInputStream(bos.toByteArray());
  parse(bis);
  bis.close();
  saved = true;
} catch (IOException ex) {

代码示例来源:origin: javax.mail/javax.mail-api

new SharedByteArrayInputStream(bos.toByteArray());
  parse(bis);
  bis.close();
  saved = true;
} catch (IOException ex) {

代码示例来源:origin: org.glassfish.metro/webservices-extra

new SharedByteArrayInputStream(bos.toByteArray());
  parse(bis);
  bis.close();
  saved = true;
} catch (IOException ex) {

代码示例来源:origin: com.sun.mail/android-mail

new SharedByteArrayInputStream(bos.toByteArray());
  parse(bis);
  bis.close();
  saved = true;
} catch (IOException ex) {

代码示例来源:origin: org.ow2.petals/petals-bc-mail

bis.close();

相关文章

微信公众号

最新文章

更多