FDO .NET API Reference Feature Data Objects

mgIoByteStreamReader.h

Go to the documentation of this file.
00001 /*
00002 * Copyright (C) 2004-2006  Autodesk, Inc.
00003 * 
00004 * This library is free software; you can redistribute it and/or
00005 * modify it under the terms of version 2.1 of the GNU Lesser
00006 * General Public License as published by the Free Software Foundation.
00007 * 
00008 * This library is distributed in the hope that it will be useful,
00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 * Lesser General Public License for more details.
00012 * 
00013 * You should have received a copy of the GNU Lesser General Public
00014 * License along with this library; if not, write to the Free Software
00015 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00016 *
00017 */
00018 
00019 #pragma once
00020 
00021 #include "Common\mgIStreamReaderImp.h"
00022 
00023 class FdoIoByteStreamReader;
00024 
00025 BEGIN_NAMESPACE_OSGEO_COMMON_IO
00026 public __gc class IoStream;
00027 
00028 /// \ingroup (OSGeoFDOCommonIo)
00029 /// \brief
00030 ///     IoByteStreamReader is an FDO reader for a Byte stream.
00031 public __sealed __gc class IoByteStreamReader : public NAMESPACE_OSGEO_COMMON::IStreamReaderImp
00032 {
00033 public:
00034     /// \brief
00035     ///     Creates a Byte Stream reader. Reads binary data from an IoStream
00036     /// 
00037     /// \param stream 
00038     ///     Input the stream to read from
00039     /// 
00040     IoByteStreamReader(NAMESPACE_OSGEO_COMMON_IO::IoStream* stream);
00041     
00042     /// \brief
00043     ///     Skips a number of items
00044     /// 
00045     /// \param offset 
00046     ///     Input number of items to skip
00047     /// 
00048     System::Void Skip(System::Int32 offset);
00049 
00050     /// \brief
00051     ///     Resets the current index to the stream start. Allows re-reading.
00052     /// 
00053     System::Void Reset();  
00054 
00055     /// \brief
00056     ///     Reads in the next block of items. The caller is responsible to allocate a buffer large 
00057     ///     enough to store data.
00058     /// 
00059     /// \param buffer 
00060     ///     Output array holding data read in.
00061     ///
00062     /// \return
00063     ///     Returns the number of items actually read in. When 0 (zero) then the 
00064     ///     end-of-stream was reached.
00065     /// 
00066     System::Int32 ReadNext(System::Byte buffer[]);
00067 
00068     /// \brief
00069     ///     Reads in the next block of items. Use ReadNext( buffer) to read in 
00070     ///     the entire stream. The caller is responsible to allocate a buffer large 
00071     ///     enough to store data.
00072     /// 
00073     /// \param buffer 
00074     ///     Output array holding data read in.
00075     ///
00076     /// \param offset 
00077     ///     Input index in the array indicating the beginning of the output buffer. 
00078     ///     If zero, then the buffer is reused. If the end of the buffer, then read in 
00079     ///     appending mode. Throws "out-of-bounds" exception if not in this range.
00080     ///
00081     /// \return
00082     ///     Returns the number of items actually read in. When 0 (zero) then the 
00083     ///     end-of-stream was reached.
00084     /// 
00085     System::Int32 ReadNext(System::Byte buffer[], System::Int32 offset);
00086 
00087     /// \brief
00088     ///     Reads in the next block of items. Use ReadNext( buffer) to read in 
00089     ///     the entire stream. The caller is responsible to allocate a buffer large 
00090     ///     enough to store data.
00091     /// 
00092     /// \param buffer 
00093     ///     Output array holding data read in.
00094     ///
00095     /// \param offset 
00096     ///     Input index in the array indicating the beginning of the output buffer. 
00097     ///     If zero, then the buffer is reused. If the end of the buffer, then read in 
00098     ///     appending mode. Throws "out-of-bounds" exception if not in this range.
00099     ///
00100     /// \param count 
00101     ///     Input number of items to be read in. If -1 read the entire stream.
00102     ///     Throws "out-of-bounds"  exception if not a positive value or -1.
00103     /// 
00104     /// \return
00105     ///     Returns the number of items actually read in. When 0 (zero) then the 
00106     ///     end-of-stream was reached.
00107     /// 
00108     System::Int32 ReadNext(System::Byte buffer[], System::Int32 offset, System::Int32 count);
00109 
00110     /// \brief
00111     ///     Gets the stream length
00112     /// 
00113     /// \return
00114     ///     Returns the size of the data source in number of items 
00115     /// 
00116     ///  
00117     __property System::Int64 get_Length();   
00118 
00119     /// \brief
00120     ///     Gets the current stream position. Position is 
00121     ///     measured by number of items from the stream start
00122     /// 
00123     /// \return
00124     ///     Returns the current index in the stream
00125     /// 
00126     __property System::Int64 get_Index();  
00127 
00128     /// \brief
00129     ///     Constructs a stream reader based on an unmanaged instance of the object
00130     /// 
00131     /// \param unmanaged 
00132     ///     Input A Pointer to the unmanaged stream reader.
00133     /// 
00134     /// \param autoDelete 
00135     ///     Input Indicates if the constructed object should be automatically deleted 
00136     ///     once it no longer referenced.
00137     /// 
00138     IoByteStreamReader(System::IntPtr unmanaged, System::Boolean autoDelete);
00139 
00140 /// \cond DOXYGEN-IGNORE
00141 public private:
00142     inline FdoIoByteStreamReader* GetImpObj();
00143 /// \endcond
00144 };
00145 
00146 END_NAMESPACE_OSGEO_COMMON_IO
00147 
00148 

Comments or suggestions? Send us feedback.