Defines common operations for IDataStream objects.
interface
|
IDataStreamOps
|
extends
|
ITextStreamFactory
|
||
base of
|
IDataStream
|
Uses a background thread to prefetch data from this data stream.
[OwnerReturn, OwnerThis]
|
||||
method
|
Background
(int32 bufferSize = 65536,
int32 bufferCount = 16)
|
|||
type
|
IDataStream
|
|||
params
|
bufferSize
|
[>0]
|
The
buffer
size,
in
bytes.
Defaults
to
65536 . |
|
bufferCount
|
[>0]
|
The
buffer
count.
Defaults
to
16 . |
||
returns
|
|
The sequential read-only data stream. |
Remarks:
If
this
data
stream
is
already
being
prefetched
in
a
background
thread,
this
method
may
return
this
.
The
resulting
data
stream
does
not
support
seeking
(i.e.
CanSeek
returns
false
)
and
it
will
be
in
read-only
(
CanRead)
mode.
Wraps this data stream in a buffered stream.
[OwnerReturn, OwnerThis]
|
||||
method
|
Buffer
(int32 bufferSize = 65536)
|
|||
type
|
IDataStream
|
|||
params
|
bufferSize
|
[>0]
|
The
buffer
size,
in
bytes.
Defaults
to
65536 . |
|
returns
|
|
The buffered data stream. |
Remarks:
If
this
data
stream
is
already
buffered
in
memory,
this
method
may
return
this
.
If both read and write operations are going to be used on the returned stream, seeking must be supported by this stream (see CanSeek).
Reads all remaining data from this stream and disposes it.
[OwnerReturn, OwnerThis]
|
||||
method
|
ReadToEnd
()
|
|||
type
|
ByteBuffer
|
|||
returns
|
|
The read bytes. |
Converts this data stream into a random-access file.
[OwnerReturn, OwnerThis]
|
||||
method
|
ToFile
()
|
|||
type
|
IFile
|
|||
returns
|
|
The data file. |
Remarks:
It may be necessary to copy the data stream bytes to a temporary file.
Creates an ITextStream from the data of this object.
[OwnerReturn, OwnerThis]
|
||||
method
|
ToTextStream
(CharacterEncoding encoding)
|
|||
type
|
ITextStream
|
|||
params
|
encoding
|
[not-null]
|
The character encoding to use. | |
returns
|
|
The data stream. | ||
inherited
|
ITextStreamFactory.ToTextStream
|