• Api Documentation
  • Source Code
Search Results for

    Show / Hide Table of Contents
    • SharpAssimp
      • Animation
      • AnimationBehaviour
      • AnimationInterpolation
      • AssimpContext
      • AssimpException
      • BlendMode
      • Bone
      • BoundingBox
      • Camera
      • CompileFlags
      • ConsoleLogStream
      • DefaultLogStream
      • EmbeddedTexture
      • ExcludeComponent
      • ExportDataBlob
      • ExportFormatDescription
      • Face
      • FileIOMode
      • FileIOSystem
      • FreeNativeDelegate
      • IMarshalable<Managed, Native>
      • INativeCustomMarshaler
      • IOStream
      • IOSystem
      • ImporterDescription
      • ImporterFeatureFlags
      • Light
      • LightSourceType
      • LogStream
      • LoggingCallback
      • Material
      • Material.PBRMaterialProperties
      • Material.ShaderMaterialProperties
      • MaterialProperty
      • Matrix3x3
      • MemoryHelper
      • Mesh
      • MeshAnimationAttachment
      • MeshAnimationChannel
      • MeshKey
      • MeshMorphAnimationChannel
      • MeshMorphKey
      • MeshMorphingMethod
      • MetaDataType
      • Metadata
      • Metadata.Entry
      • NativeCustomMarshalerAttribute
      • Node
      • NodeAnimationChannel
      • NodeCollection
      • Origin
      • PostProcessPreset
      • PostProcessSteps
      • PrimitiveType
      • PropertyType
      • QuaternionKey
      • Ray
      • ReturnCode
      • Scene
      • SceneFlags
      • ShadingMode
      • Texel
      • TextureFlags
      • TextureMapping
      • TextureOperation
      • TextureSlot
      • TextureType
      • TextureWrapMode
      • UVTransform
      • UVTransformFlags
      • VectorKey
      • VertexWeight
    • SharpAssimp.Configs
      • ACEvaluateSubdivisionConfig
      • ACSeparateBackfaceCullConfig
      • ASEReconstructNormalsConfig
      • AnimationAccuracyConfig
      • AppScaleConfig
      • BooleanPropertyConfig
      • ColladaIgnoreUpDirectionConfig
      • ColladaUseColladaNamesConfig
      • DeboneAllOrNoneConfig
      • DeboneThresholdConfig
      • ExportPointCloudsConfig
      • FBXConvertToMetersConfig
      • FBXImportAllGeometryLayersConfig
      • FBXImportAllMaterialsConfig
      • FBXImportAnimationsConfig
      • FBXImportCamerasConfig
      • FBXImportEmbeddedTexturesConfig
      • FBXImportEmbeddedTexturesLegacyNamingConfig
      • FBXImportLightsConfig
      • FBXImportMaterialsConfig
      • FBXOptimizeEmptyAnimationCurvesConfig
      • FBXPreservePivotsConfig
      • FBXStrictModeConfig
      • FavorSpeedConfig
      • FloatPropertyConfig
      • GlobalKeyFrameImportConfig
      • GlobalScaleConfig
      • IFCCylindricalTessellationConfig
      • IFCSkipSpaceRepresentationsConfig
      • IFCSmoothingAngleConfig
      • IFCUseCustomTriangulationConfig
      • IRRAnimationFrameRateConfig
      • IgnoreTextureCoordinatesConfig
      • IntegerPropertyConfig
      • KeepSceneHierarchyConfig
      • LWOImportOneLayerConfig
      • LWSAnimationEndConfig
      • LWSAnimationStartConfig
      • MD2KeyFrameImportConfig
      • MD3HandleMultiPartConfig
      • MD3KeyFrameImportConfig
      • MD3ShaderSourceConfig
      • MD3SkinNameConfig
      • MD5NoAnimationAutoLoadConfig
      • MDLColorMapConfig
      • MDLKeyFrameImportConfig
      • MaterialExcludeListConfig
      • MatrixPropertyConfig
      • MaxBoneCountConfig
      • MeasureTimeConfig
      • MeshTriangleLimitConfig
      • MeshVertexLimitConfig
      • MultithreadingConfig
      • NoSkeletonMeshesConfig
      • NodeExcludeListConfig
      • NormalSmoothingAngleConfig
      • NormalizeVertexComponentsConfig
      • OgreMaterialFileConfig
      • OgreTextureTypeFromFilenameConfig
      • PropertyConfig
      • RemoveComponentConfig
      • RemoveDegeneratePrimitivesCheckAreaConfig
      • RemoveDegeneratePrimitivesConfig
      • RemoveEmptyBonesConfig
      • RootTransformationConfig
      • SMDKeyFrameImportConfig
      • SmdLoadAnimationListConfig
      • SortByPrimitiveTypeConfig
      • StringPropertyConfig
      • TangentSmoothingAngleConfig
      • TangentTextureChannelIndexConfig
      • TerragenComputeTexCoordsConfig
      • TransformUVConfig
      • UnrealHandleFlagsConfig
      • UnrealKeyFrameImportConfig
      • VertexBoneWeightLimitConfig
      • VertexCacheSizeConfig
      • XFileUseDoublesConfig
    • SharpAssimp.Unmanaged
      • AiAnimMesh
      • AiAnimation
      • AiBone
      • AiCamera
      • AiConfigs
      • AiDefines
      • AiExportDataBlob
      • AiExportFormatDesc
      • AiFace
      • AiFile
      • AiFileCloseProc
      • AiFileFlushProc
      • AiFileIO
      • AiFileOpenProc
      • AiFileReadProc
      • AiFileSeek
      • AiFileTellProc
      • AiFileWriteProc
      • AiImporterDesc
      • AiLight
      • AiLogStream
      • AiLogStreamCallback
      • AiMatKeys
      • AiMaterial
      • AiMaterialProperty
      • AiMemoryInfo
      • AiMesh
      • AiMeshAnim
      • AiMeshColorArray
      • AiMeshMorphAnim
      • AiMeshMorphKey
      • AiMeshTextureCoordinateArray
      • AiMeshUVComponentArray
      • AiMetadata
      • AiMetadataEntry
      • AiNode
      • AiNodeAnim
      • AiScene
      • AiString
      • AiTexture
      • AssimpLibrary
      • Platform
      • UnmanagedFunctionNameAttribute
      • UnmanagedLibrary
      • UnmanagedLibraryResolver

    Class IOStream

    Defines a stream to some file input or output source. This object is responsible for reading/writing data that is used by Assimp.

    Inheritance
    object
    IOStream
    Implements
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: SharpAssimp
    Assembly: SharpAssimp.dll
    Syntax
    public abstract class IOStream : IDisposable

    Constructors

    | Edit this page View Source

    IOStream(string, FileIOMode)

    Constructs a new IOStream.

    Declaration
    public IOStream(string pathToFile, FileIOMode fileMode)
    Parameters
    Type Name Description
    string pathToFile

    Path to file given by Assimp

    FileIOMode fileMode

    Desired file access mode

    | Edit this page View Source

    IOStream(string, FileIOMode, bool)

    Constructs a new IOStream.

    Declaration
    protected IOStream(string pathToFile, FileIOMode fileMode, bool initialize = true)
    Parameters
    Type Name Description
    string pathToFile

    Path to file given by Assimp

    FileIOMode fileMode

    Desired file access mode

    bool initialize

    True if initialize should be immediately called with the default callbacks. Set this to false if your subclass requires a different way to setup the function pointers.

    Properties

    | Edit this page View Source

    FileMode

    Gets the original desired file access mode.

    Declaration
    public FileIOMode FileMode { get; }
    Property Value
    Type Description
    FileIOMode
    | Edit this page View Source

    IsDisposed

    Gets whether or not this IOStream has been disposed.

    Declaration
    public bool IsDisposed { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    IsValid

    Gets whether the stream is in fact valid - that is, the input/output has been properly located and can be read/written.

    Declaration
    public abstract bool IsValid { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    PathToFile

    Gets the original path to file given by Assimp.

    Declaration
    public string PathToFile { get; }
    Property Value
    Type Description
    string

    Methods

    | Edit this page View Source

    Close()

    Closes the stream - flushing any data not yet read/written and disposes of resources.

    Declaration
    public virtual void Close()
    | Edit this page View Source

    Dispose()

    Disposes of resources held by the IOStream.

    Declaration
    public void Dispose()
    | Edit this page View Source

    Dispose(bool)

    Releases unmanaged and - optionally - managed resources.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing

    True to release both managed and unmanaged resources; False to release only unmanaged resources.

    | Edit this page View Source

    ~IOStream()

    Finalizes an instance of the IOStream class.

    Declaration
    protected ~IOStream()
    | Edit this page View Source

    Flush()

    Flushes all data currently in the stream buffers.

    Declaration
    public abstract void Flush()
    | Edit this page View Source

    GetFileSize()

    Gets the total file size (in bytes).

    Declaration
    public abstract long GetFileSize()
    Returns
    Type Description
    long

    File size in bytes

    | Edit this page View Source

    GetPosition()

    Gets the current file position pointer (in bytes).

    Declaration
    public abstract long GetPosition()
    Returns
    Type Description
    long

    Current file position pointer (in bytes)

    | Edit this page View Source

    Initialize(AiFileWriteProc, AiFileReadProc, AiFileTellProc, AiFileTellProc, AiFileSeek, AiFileFlushProc, nint)

    Initializes the system by setting up native pointers for Assimp to the specified functions. A reference to each supplied callback is held on to avoid it being GC'ed.

    Declaration
    protected void Initialize(AiFileWriteProc aiFileWriteProc, AiFileReadProc aiFileReadProc, AiFileTellProc aiFileTellProc, AiFileTellProc aiFileSizeProc, AiFileSeek aiFileSeek, AiFileFlushProc aiFileFlushProc, nint userData = 0)
    Parameters
    Type Name Description
    AiFileWriteProc aiFileWriteProc

    Handles write requests.

    AiFileReadProc aiFileReadProc

    Handles read requests.

    AiFileTellProc aiFileTellProc

    Handles tell requests.

    AiFileTellProc aiFileSizeProc

    Handles size requests.

    AiFileSeek aiFileSeek

    Handles seek requests.

    AiFileFlushProc aiFileFlushProc

    Handles flush requests.

    nint userData

    Additional user data, if any.

    | Edit this page View Source

    OnAiFileFlushProc(nint)

    Callback for Assimp that handles flushes.

    Declaration
    protected void OnAiFileFlushProc(nint file)
    Parameters
    Type Name Description
    nint file
    | Edit this page View Source

    OnAiFileReadProc(nint, nint, nuint, nuint)

    Callback for Assimp that handles reads.

    Declaration
    protected nuint OnAiFileReadProc(nint file, nint dataRead, nuint sizeOfElemInBytes, nuint numElements)
    Parameters
    Type Name Description
    nint file
    nint dataRead
    nuint sizeOfElemInBytes
    nuint numElements
    Returns
    Type Description
    nuint
    | Edit this page View Source

    OnAiFileSeekProc(nint, nuint, Origin)

    Callback for Assimp that handles seeks.

    Declaration
    protected ReturnCode OnAiFileSeekProc(nint file, nuint offset, Origin seekOrigin)
    Parameters
    Type Name Description
    nint file
    nuint offset
    Origin seekOrigin
    Returns
    Type Description
    ReturnCode
    | Edit this page View Source

    OnAiFileSizeProc(nint)

    Callback for Assimp that handles size requests.

    Declaration
    protected nuint OnAiFileSizeProc(nint file)
    Parameters
    Type Name Description
    nint file
    Returns
    Type Description
    nuint
    | Edit this page View Source

    OnAiFileTellProc(nint)

    Callback for Assimp that handles tell requests.

    Declaration
    protected nuint OnAiFileTellProc(nint file)
    Parameters
    Type Name Description
    nint file
    Returns
    Type Description
    nuint
    | Edit this page View Source

    OnAiFileWriteProc(nint, nint, nuint, nuint)

    Callback for Assimp that handles writes.

    Declaration
    protected nuint OnAiFileWriteProc(nint file, nint dataToWrite, nuint sizeOfElemInBytes, nuint numElements)
    Parameters
    Type Name Description
    nint file
    nint dataToWrite
    nuint sizeOfElemInBytes
    nuint numElements
    Returns
    Type Description
    nuint
    | Edit this page View Source

    Read(byte[], long)

    Reads data from the stream.

    Declaration
    public abstract long Read(byte[] dataRead, long count)
    Parameters
    Type Name Description
    byte[] dataRead

    Byte buffer to store the read data in

    long count

    Number of bytes to read

    Returns
    Type Description
    long

    Number of bytes actually read. Should be equal to the specified count, unless if EoF was hit or an error occured.

    | Edit this page View Source

    Seek(long, Origin)

    Sets the current file position pointer.

    Declaration
    public abstract ReturnCode Seek(long offset, Origin seekOrigin)
    Parameters
    Type Name Description
    long offset

    Offset in bytes from the origin

    Origin seekOrigin

    Origin reference

    Returns
    Type Description
    ReturnCode

    ReturnCode indicating success or failure.

    | Edit this page View Source

    Write(byte[], long)

    Writes data to the stream.

    Declaration
    public abstract long Write(byte[] dataToWrite, long count)
    Parameters
    Type Name Description
    byte[] dataToWrite

    Data to write

    long count

    Number of bytes to write

    Returns
    Type Description
    long

    Number of bytes actually written. Should be equal to the specified count, unless if EoF was hit or an error occured.

    Implements

    IDisposable
    • Edit this page
    • View Source
    In this article
    Back to top Copyright (c) 2012-2020 Nicholas Woodfield, (c) 2024 Salvage, (c) 2025 Jérémy Ansel