As you yourself wrote "pipe the output".... Well then, use pipes, these are there for just that and more...
There's a good pipes example in the standard distribution. Your approach is likely to fail at least on some platforms because a console may filter one or more byte values anyway.
A true pipe won't do that.
anyway, following Marco's hint a small example that may or may not work:
program streamtest;
{$ifdef fpc}{$mode delphi}{$H+}{$endif}
uses classes, sysutils;
var
stream:THandleStream;
buffer:array[0..5] of char = 'testme'; // any data
begin
stream := THandleStream.Create(GetFileHandle(output));
try
stream.write(buffer,length(buffer));
finally
stream.free;
end;
end.
This example works on windows and linux, but note my remarks on console/terminal filtering certain byte values.