本文整理汇总了C++中ObjectOutputStream::writeInt方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectOutputStream::writeInt方法的具体用法?C++ ObjectOutputStream::writeInt怎么用?C++ ObjectOutputStream::writeInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectOutputStream
的用法示例。
在下文中一共展示了ObjectOutputStream::writeInt方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: changeVariableData
ObjectOutputStream* ObjectVersionUpdateManager::changeVariableData(const uint32& variableHashCode, ObjectInputStream* object, Stream* newVariableData) {
int offset = getVariableDataOffset(variableHashCode, object);
if (offset == -1)
return NULL;
ObjectOutputStream* newData = new ObjectOutputStream(object->size());
object->copy(newData);
object->reset();
newData->reset();
object->shiftOffset(offset - 4);
uint32 dataSize = object->readInt();
newData->shiftOffset(offset); //we go data length
if (dataSize > 0)
newData->removeRange(offset, offset + dataSize);
newData->writeInt(offset - 4, newVariableData->size());
newData->insertStream(newVariableData, newVariableData->size(), offset);
object->reset();
//newData->reset();
return newData;
}
示例2: serializeElement
void Element::serializeElement(ObjectOutputStream& out)
{
XOJ_CHECK_TYPE(Element);
out.writeObject("Element");
out.writeDouble(this->x);
out.writeDouble(this->y);
out.writeInt(this->color);
out.endObject();
}
示例3: serialize
void EditSelection::serialize(ObjectOutputStream & out) {
out.writeObject("EditSelection");
out.writeDouble(this->x);
out.writeDouble(this->y);
out.writeDouble(this->width);
out.writeDouble(this->height);
out << this->contents;
out.endObject();
ListIterator<Element *> it = this->getElements();
int count = it.getLength();
out.writeInt(count);
while (it.hasNext()) {
Element * e = it.next();
out << e;
}
}
示例4: addVariable
ObjectOutputStream* ObjectVersionUpdateManager::addVariable(String variableName, ObjectInputStream* object, Stream* newVariableData){
object->reset();
uint16 oldVariableCount = object->readShort();
//info("first variable count is " + String::valueOf(oldVariableCount),true);
ObjectOutputStream* newData = new ObjectOutputStream(object->size());
object->copy(newData, 0);
newData->writeShort(0, oldVariableCount + 1);
newData->setOffset(newData->size());
uint32 _nameHashCode = variableName.hashCode();
TypeInfo<uint32>::toBinaryStream(&_nameHashCode, newData);
newData->writeInt(newVariableData->size());
newData->writeStream(newVariableData);
return newData;
}
示例5: writeObject
void DObject::writeObject (ObjectOutputStream& out) const
{
out.writeInt(oid);
}