Last active
February 15, 2018 07:31
-
-
Save Scooletz/8419673fdfc3479c589bab88c25dbc8f to your computer and use it in GitHub Desktop.
EventStore's TFChunk writing a reversable entry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var workItem = _writerWorkItem; | |
var buffer = workItem.Buffer; | |
var bufferWriter = workItem.BufferWriter; | |
buffer.SetLength(4); | |
buffer.Position = 4; | |
record.WriteTo(bufferWriter); | |
var length = (int) buffer.Length - 4; | |
bufferWriter.Write(length); // length suffix | |
buffer.Position = 0; | |
bufferWriter.Write(length); // length prefix |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment