output_raw(FILE *rf, int32_t len, FILE *f)
{
  char buf[2048];
  reposition(rf, 0);
  while (len > 0) {
    int n = (len < 2048 ? len : 2048);
    fread(buf, 1, n, rf);
    fwrite(buf, 1, n, f);
    len -= n;
  }
}
output_raw(FILE *rf, int32_t len, FILE *f)
{
  char buf[2048];
  reposition(rf, 0);
  while (len > 0) {
    int n = (len < 2048 ? len : 2048);
    fread(buf, 1, n, rf);
    fwrite(buf, 1, n, f);
    len -= n;
  }
}