SK.gnome.dwarf.mail.mime
Interface SharedInputStreamSource

All Known Implementing Classes:
FileSource, StreamSource

public interface SharedInputStreamSource

Provides a stream source for the StreamMimePart.

A shared input stream source is able to create new streams based on the original input stream source. Each new stream may begin at an arbitrary position of the base stream and its size may be limited to an arbitrary length, not larger than the base stream's length. You can imagine these substreams as a windows to the original stream source.


Method Summary
 int getSize()
          Returns the size of the base stream.
 java.io.InputStream newStream(int offset, int length)
          Creates a new stream from the underlying source stream.
 

Method Detail

newStream

public java.io.InputStream newStream(int offset,
                                     int length)
                              throws java.io.IOException,
                                     MimeException
Creates a new stream from the underlying source stream.

The new stream begins at the offset position of the original source stream and its total length is limited to length octets.

The returned input stream may be buffered for a better efficiency.

Parameters:
offset - the offset
length - the length
Returns:
the new input stream
Throws:
java.io.IOException - if an error occurs
MimeException

getSize

public int getSize()
Returns the size of the base stream.

Returns:
the size of the base stream


Copyright (c) 2004-2005, Gnome Ltd. All rights reserved.