示例#1
1
void GzWriter::writeString(string s)
{
  int16_t i = (int16_t)(s.size());
  swap_endian(i);
  out.write(reinterpret_cast<const char*>(&i),sizeof(i));
  out.write(reinterpret_cast<const char*>(&s[0]),s.size());
}
示例#2
0
 void writeDouble(double d)
 {swap_endian(d); out.write(reinterpret_cast<const char*>(&d),sizeof(d));};
示例#3
0
 void writeInt(int i) 
 {swap_endian(i); out.write(reinterpret_cast<const char*>(&i),sizeof(i));};