title: How to read and write a PDF file using TStreamWriter and TStreamReader?
body: <p>Here is my code:</p>
  
  <pre><code>procedure TForm1.Button2Click(Sender: TObject);
  var
    Reader: TStreamReader;
    Writer: TStreamWriter;
  begin
    Reader := TStreamReader.Create('D:\Downloads\cover.pdf', TEncoding.UTF8, False);
    try
      Writer := TStreamWriter.Create('D:\Downloads\coverb.pdf', False, TEncoding.UTF8);
      try
        Writer.Write(Reader.ReadToEnd());
      finally
        Writer.Free;
        ShowMessage('Berhasil');
      end;
    finally
      Reader.Free();
    end;
  end;
  </code></pre>
  
  <p>Using the above code, <code>Reader.ReadToEnd()</code>, I got no string, and <em>coverb.pdf</em> is empty.</p>
  
  <p>I'm using Delphi XE.</p>