FDO .NET API Reference Feature Data Objects
Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

OSGeo::FDO::Common::Io::IoStream Class Reference

Inherits OSGeo::FDO::Runtime::Disposable.

Inherited by OSGeo::FDO::Common::Io::IoFileStream, and OSGeo::FDO::Common::Io::IoMemoryStream.

Inheritance diagram for OSGeo::FDO::Common::Io::IoStream:

[legend]
List of all members.

Detailed Description

IoStream defines the interface for all FDO streams. Streamed I/O support for various locations, such as files, memory, etc. can be provided by classes that implement this interface.


Public Member Functions

System::Void Close ()
 Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream.
virtual __property System::Boolean get_CanRead ()
 Gets the reading capability of the stream.
virtual __property System::Boolean get_CanWrite ()
 Gets the writing capability of the stream.
virtual __property System::Boolean get_HasContext ()
 returns whether the stream has any positional context. Streams without context can only be read and written in a forward-only manner. These streams do not allow position and length changes.
virtual __property System::Int64 get_Index ()
 gets the current position for the stream.
virtual __property System::Int64 get_Length ()
 gets the current length of the stream.
 IoStream (System::IntPtr unmanaged, System::Boolean autoDelete)
 Constructs a stream based on an unmanaged instance of the object.
virtual System::UInt32 Read (System::Byte buffer[], System::UInt32 count)
 reads the number of bytes indicated by count into the given buffer, or the number of bytes after the current stream position, whichever is less. The stream’s current position is moved ahead by the number of bytes read.
virtual System::Void Reset ()
 sets the position to the start of the stream.
virtual __property System::Void set_Length (System::Int64 length)
 truncates the stream to the indicated length.
virtual System::Void Skip (System::Int64 count)
 skips over part of the stream.
virtual System::Void Write (OSGeo::FDO::Common::Io::IoStream *stream, System::UInt32 count)
 reads the number of bytes from the given stream, and writes them to this stream.
virtual System::Void Write (OSGeo::FDO::Common::Io::IoStream *stream)
 reads the number of bytes from the given stream, and writes them to this stream.
virtual System::Void Write (System::Byte buffer[], System::UInt32 count)
 writes the number of bytes indicated by count, from the given buffer, to the stream. The current position is moved ahead by the number of bytes written.

Protected Member Functions

 IoStream ()
 DOXYGEN-IGNORE
System::Void ReleaseUnmanagedObject ()

Constructor & Destructor Documentation

OSGeo::FDO::Common::Io::IoStream::IoStream System::IntPtr  unmanaged,
System::Boolean  autoDelete
 

Constructs a stream based on an unmanaged instance of the object.

Parameters:
unmanaged Input A Pointer to the unmanaged stream.
autoDelete Input Indicates if the constructed object should be automatically deleted once it no longer referenced.

OSGeo::FDO::Common::Io::IoStream::IoStream  )  [protected]
 

DOXYGEN-IGNORE


Member Function Documentation

System::Void OSGeo::FDO::Common::Io::IoStream::Close  ) 
 

Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream.

Remarks:
Note: A call to Close is required for proper operation of a stream. Following a call to Close, other operations on the stream could throw exceptions. If the stream is already closed, a call to Close throws no exceptions.

virtual __property System::Boolean OSGeo::FDO::Common::Io::IoStream::get_CanRead  )  [virtual]
 

Gets the reading capability of the stream.

Returns:
Returns true if the stream can be read.

virtual __property System::Boolean OSGeo::FDO::Common::Io::IoStream::get_CanWrite  )  [virtual]
 

Gets the writing capability of the stream.

Returns:
Returns true if the stream can be written to.

virtual __property System::Boolean OSGeo::FDO::Common::Io::IoStream::get_HasContext  )  [virtual]
 

returns whether the stream has any positional context. Streams without context can only be read and written in a forward-only manner. These streams do not allow position and length changes.

Returns:
Returns true if the stream has context. Returns false if it does not. When a stream does not have context, the SetLength(), Skip() and Reset() functions are not supported.

virtual __property System::Int64 OSGeo::FDO::Common::Io::IoStream::get_Index  )  [virtual]
 

gets the current position for the stream.

Returns:
Returns the position in bytes from the start. When 0, the the position is at the start of the stream. When Index() == Length() the position is at the end of the stream.

virtual __property System::Int64 OSGeo::FDO::Common::Io::IoStream::get_Length  )  [virtual]
 

gets the current length of the stream.

Returns:
Returns the length in bytes. Returns -1 if the length is unknown or undefined.

virtual System::UInt32 OSGeo::FDO::Common::Io::IoStream::Read System::Byte  buffer[],
System::UInt32  count
[virtual]
 

reads the number of bytes indicated by count into the given buffer, or the number of bytes after the current stream position, whichever is less. The stream’s current position is moved ahead by the number of bytes read.

Parameters:
buffer Output read into this buffer
count Input read this number of bytes into the buffer. The caller is responsible for allocating a buffer that is large enough to hold the bytes.
Returns:
Returns the number of bytes that were read. 0 if already at the end of the stream.

System::Void OSGeo::FDO::Common::Io::IoStream::ReleaseUnmanagedObject  )  [protected, virtual]
 

Reimplemented from OSGeo::FDO::Runtime::Disposable.

virtual System::Void OSGeo::FDO::Common::Io::IoStream::Reset  )  [virtual]
 

sets the position to the start of the stream.

virtual __property System::Void OSGeo::FDO::Common::Io::IoStream::set_Length System::Int64  length  )  [virtual]
 

truncates the stream to the indicated length.

Parameters:
length Input the new length (in bytes) for the stream. If this is longer than the current stream length then the stream's length is not changed.

virtual System::Void OSGeo::FDO::Common::Io::IoStream::Skip System::Int64  count  )  [virtual]
 

skips over part of the stream.

Parameters:
count The number of bytes to skip. if positive then the current position is moved forward. If negative, the position is moved backward. The position will remain between the start and end of the stream. The position is set to the end of the stream if the given offset would put it past the end. Similarily, if the position is set to the start if the offset would put it before the start.

virtual System::Void OSGeo::FDO::Common::Io::IoStream::Write OSGeo::FDO::Common::Io::IoStream stream,
System::UInt32  count
[virtual]
 

reads the number of bytes from the given stream, and writes them to this stream.

Parameters:
stream Input write from this buffer
count Input the maximum number of bytes to read and write. When 0, all remaining bytes are read from the given stream.

virtual System::Void OSGeo::FDO::Common::Io::IoStream::Write OSGeo::FDO::Common::Io::IoStream stream  )  [virtual]
 

reads the number of bytes from the given stream, and writes them to this stream.

Parameters:
stream Input write from this buffer

virtual System::Void OSGeo::FDO::Common::Io::IoStream::Write System::Byte  buffer[],
System::UInt32  count
[virtual]
 

writes the number of bytes indicated by count, from the given buffer, to the stream. The current position is moved ahead by the number of bytes written.

Parameters:
buffer Intput write from this buffer
count Input number of bytes to write
Remarks:
Note: Write will overwrite some of the contents of the stream if the current position is not at the end of the stream.

Comments or suggestions? Send us feedback.