dotConnect for Oracle Documentation
Devart.Data.Oracle Namespace / OracleLob Class / Position Property
Example

In This Topic
    Position Property (OracleLob)
    In This Topic
    Gets the current read position in the OracleLob stream.
    Syntax
    'Declaration
     
    Public Overrides Property Position As Long
    public override long Position {get; set;}

    Property Value

    The current position within the OracleLob stream.
    Remarks
    The stream must support seeking to get or set the position. Use the CanSeek property to determine whether the stream supports seeking.
    Example
    static void ReverseBlob() 
    { 
            byte[] byteArray = { (byte)'A', (byte)'B', (byte)'C' }; 
            OracleLob blobFrom = new OracleLob(OracleDbType.Blob);
            blobFrom.Write(byteArray, 0, byteArray.Length);
            //blobFrom.ToString() = "ABC" 
    
            OracleLob blobTo = new OracleLob(OracleDbType.Blob); 
            ........
            //reverse OracleLob 
            if (blobFrom.CanSeek && blobFrom.CanRead && blobTo.CanWrite) 
                    for (blobFrom.Seek(-1, System.IO.SeekOrigin.End); ;blobFrom.Position -= 2) 
                    { 
                            blobTo.WriteByte((byte)blobFrom.ReadByte()); 
                            if (blobFrom.Position == 1) break; 
                    } 
            //blobTo.ToString() = "CBA"; 
    }
    Private Sub ReverseBlob()
            Dim byteArray As Byte() = New Byte() {AscW("A"c), AscW("B"c), AscW("C"c)}
            Dim blobFrom As New OracleLob(OracleDbType.Blob)
            blobFrom.Write(byteArray, 0, byteArray.Length)
            ' blobFrom.ToString() = "ABC"
    
            Dim blobTo As New OracleLob(OracleDbType.Blob)
            ........
            ' reverse OracleLob
            If ((blobFrom.CanSeek AndAlso blobFrom.CanRead) AndAlso blobTo.CanWrite) Then
                    blobFrom.Seek(CLng(-1), System.IO.SeekOrigin.End)
                    Do While True
                            blobTo.WriteByte(CByte(blobFrom.ReadByte))
                            If (blobFrom.Position = 1) Then
                                    Return
                            End If
                            blobFrom.Position = blobFrom.Position - 2
                    Loop
            End If
            ' blobTo.ToString() = "CBA";
    End Sub
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also