Click here to Skip to main content
15,893,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a
CloudAppendBlob
to which I am appending each record as a blob.

Now I just want to read the most recent (last) block appended to that blob. Any ideas how I'd do that - there doesn't seem to be anything on the usual internet sources.

What I have tried:

I can read the whole blob to a stream thus:-
VB
Private Function GetUnderlyingStream() As System.IO.Stream

    If (AppendBlob IsNot Nothing) Then
        Dim targetStream As New System.IO.MemoryStream()
        Try
            GetAppendBlobSnapshot().DownloadToStream(targetStream)
        Catch exBlob As Microsoft.WindowsAzure.Storage.StorageException
            Throw New EventStreamReadException(DomainName, AggregateClassName, m_key.ToString(), 0, "Unable to access underlying event stream", exBlob)
        End Try
        targetStream.Seek(0, IO.SeekOrigin.Begin)
        Return targetStream
    Else
        Return Nothing
    End If

End Function


Maybe there is some way to get the offset of the last block only?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900