protoio.cc (9399:f7582cce2459) protoio.cc (9464:794711cac18b)
1/*
2 * Copyright (c) 2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 77 unchanged lines hidden (view full) ---

86 codedStream->WriteVarint32(msg.ByteSize());
87
88 // Write the message itself to the stream
89 if (!msg.SerializeToCodedStream(codedStream))
90 panic("Unable to write message to coded stream\n");
91}
92
93ProtoInputStream::ProtoInputStream(const string& filename) :
1/*
2 * Copyright (c) 2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 77 unchanged lines hidden (view full) ---

86 codedStream->WriteVarint32(msg.ByteSize());
87
88 // Write the message itself to the stream
89 if (!msg.SerializeToCodedStream(codedStream))
90 panic("Unable to write message to coded stream\n");
91}
92
93ProtoInputStream::ProtoInputStream(const string& filename) :
94 fileStream(filename, ios::in | ios::binary), fileName(filename),
94 fileStream(filename.c_str(), ios::in | ios::binary), fileName(filename),
95 useGzip(false),
96 zeroCopyStream(NULL), gzipStream(NULL), codedStream(NULL)
97{
98 if (!fileStream.good())
99 panic("Could not open %s for reading\n", filename);
100
101 // check the magic number to see if this is a gzip stream
102 unsigned char bytes[2];

--- 88 unchanged lines hidden ---
95 useGzip(false),
96 zeroCopyStream(NULL), gzipStream(NULL), codedStream(NULL)
97{
98 if (!fileStream.good())
99 panic("Could not open %s for reading\n", filename);
100
101 // check the magic number to see if this is a gzip stream
102 unsigned char bytes[2];

--- 88 unchanged lines hidden ---