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. newStream(int offset, int length)
          Creates a new stream from the underlying source stream.

Method Detail


public newStream(int offset,
                                     int length)
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.

offset - the offset
length - the length
the new input stream
Throws: - if an error occurs


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

the size of the base stream

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