Thanks for the pointer!
Good to see that someone got the time to productize the idea of Custom Index Type
With this development the win could have been even more dramatic.

My benchmark was done in  March2011,  so Caché version must have been 2010 .  
2013.1 was my last version @ISC  just rolling out.
At that time bitmaps helped only with rather relaxed precision.

For an engineer this sounds like a quite challenging exercise to rewrite a PGP lib in COS.
 

But it seems more promising to wrap the existing (and hopefully well tested) code and consume it from Caché using one of the existing Gateways:

- Callout Gateway http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...

- ActiveX Gateway  http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...

- or just  connect
over TCP/IP http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...
or UDP http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...
or a Pipe  http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...

I bet the community has even more ideas to reuse the existing code

to me this looks like your content had an extra $C(13,10) at the end.
It could help to  have the full content at hands. 
eg:
before  content.OutputToDevice()
set ck=content.Read()
set ^ck($i(^ck))=ck
do content.Rewind()

I expect  zwrite ^ck will show more than 3  lines
That would indicate that the source of trouble is on the input side. 
Some closing action ?   

1)  
%Stream.GlobalBinary has a warning:

Note that on a unicode Cache although you can write unicode data into this class and read it back out this is not a supported use of this class and the Size property would be incorrect in this case as it would be the size in characters rather than the size in bytes

2)
   do content.OutputToDevice()
now your content is out and you are positioned at end

    do content.MoveTo(content.Size)
now you re-read content until LastCharacter-1, whatever total size might be
    set isNewLineTerminator = (content.Read(1) = $char(10)) 
reading the assumed last character

3)
you might be better off to use  
content.ReadLine(,.sc,.eol) and check eol for the termination status