站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 1.2.9 API 文档英文版

InputStreamSource (Spring Framework) - Spring Framework 1.2.9 API 文档英文版


org.springframework.core.io
Interface InputStreamSource

All Known Subinterfaces:
Resource
All Known Implementing Classes:
AbstractResource, ByteArrayResource, ClassPathResource, DescriptiveResource, FileSystemResource, InputStreamResource, ServletContextResource, UrlResource

public interface InputStreamSource

Simple interface for objects that are sources for a java.io.InputStream. Base interface for Spring's more extensive Resource interface.

Useful as an abstract content source for mail attachments, for example. Spring's ByteArrayResource or any file-based Resource implementation can be used as concrete instance, allowing to read the underlying content stream multiple times. For single-use streams, InputStreamResource can be used for any given InputStream.

Since:
20.01.2004
Author:
Juergen Hoeller
See Also:
InputStream, Resource, InputStreamResource, ByteArrayResource

Method Summary
 InputStream getInputStream()
          Return an InputStream.
 

Method Detail

getInputStream

InputStream getInputStream()
                           throws IOException
Return an InputStream. It is expected that each call creates a fresh stream.

For creating mail attachments, note that JavaMail needs to be able to read the stream multiple times. For such a use case, it is required that each getInputStream() call returns a fresh stream.

Throws:
IOException - if the stream could not be opened
See Also:
MimeMessageHelper.addAttachment(String, InputStreamSource)


Copyright (c) 2002-2007 The Spring Framework Project.