nsISeekableStream 编辑
xpcom/io/nsISeekableStream.idl
Scriptable Provides seeking support in data streams. Inherits from: nsISupports
Last changed in Gecko 1.7Method overview
void seek(in long whence, in long long offset); |
void setEOF(); |
long long tell(); |
Constants
Constant | Value | Description |
NS_SEEK_SET | 0 | Specifies that the offset is relative to the start of the stream. |
NS_SEEK_CUR | 1 | Specifies that the offset is relative to the current position in the stream. |
NS_SEEK_END | 2 | Specifies that the offset is relative to the end of the stream. |
Methods
seek()
This method moves the stream offset of the stream implementing this interface.
void seek( in long whence, in long long offset );
Parameters
whence
- Specifies how to interpret the 'offset' parameter in setting the stream offset associated with the implementing stream, according to the table of constants above.
offset
- Specifies a value, in bytes, that is used in conjunction with the 'whence' parameter to set the stream offset of the implementing stream. A negative value causes seeking in the reverse direction.
Exceptions thrown
NS_BASE_STREAM_CLOSED
- If called on a closed stream.
setEOF()
This method truncates the stream at the current offset.
void setEOF();
Parameters
None.
Exceptions thrown
NS_BASE_STREAM_CLOSED
- If called on a closed stream.
tell()
This method reports the current offset, in bytes, from the start of the stream.
long long tell();
Parameters
None.
Return value
The current offset, in bytes, from the start of the stream.
Exceptions thrown
NS_BASE_STREAM_CLOSED
- If called on a closed stream.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论