Pipeline中的ReadOnlySeekableStream不包含任何内容 [英] ReadOnlySeekableStream in Pipeline contains nothing
问题描述
大家好, 如果 Hi All, if 我无法得到什么是这里有问题。 I am not able to get what is the problem here. 这篇关于Pipeline中的ReadOnlySeekableStream不包含任何内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
我有一个扩展XmlDasmComp的管道组件。在getNext方法中,我试图在返回之前将流的位置设置回0。我这样做
I have a pipeline component which extends XmlDasmComp. In the getNext method I am trying to set the position of the stream back to 0 before returning it. I am doing this
推荐答案
当你说,可搜索流不包含任何内容时,你的意思是从包装流中读取不返回数据吗?如果原始流在流的末尾,则可能发生这种情况。通过使用只读可搜索流包装原始流,您可以获得底层流的搜索行为,从当前偏移到底层流的末尾。对于已从uderlying流中读取的数据,您无法再次读取该数据。
When you say, seekable stream does not contain anything, do you mean reading from the wrapped stream returns no data?
This could happen if the original stream was at the end of stream. By wrapping the original stream with read only seekable stream, you getting the seeking behaviour for the underlying stream from the current offset to the end of the underlying stream. For data which has already been read from the uderlying stream, you can not read that data again.