@Override
 public void serialize(BserWriter writer) throws IOException {
   if (this.nextOffset != null) {
     writer.writeBytes(1, this.nextOffset);
   }
   writer.writeInt(2, this.limit);
   for (ApiUpdateOptimization i : this.optimizations) {
     writer.writeInt(3, i.getValue());
   }
 }
 public byte[] buildContainer() throws IOException {
   DataOutput res = new DataOutput();
   BserWriter writer = new BserWriter(res);
   writer.writeInt(1, getHeader());
   writer.writeBytes(2, toByteArray());
   return res.toByteArray();
 }
 @Override
 public void serialize(BserWriter writer) throws IOException {
   writer.writeInt(1, this.groupId);
   if (this.ext != null) {
     writer.writeObject(2, this.ext);
   }
 }
 @Override
 public void serialize(BserWriter writer) throws IOException {
   if (this.color == null) {
     throw new IOException();
   }
   writer.writeInt(1, this.color.getValue());
 }
 @Override
 public void serialize(BserWriter writer) throws IOException {
   if (this.groupPeer == null) {
     throw new IOException();
   }
   writer.writeObject(1, this.groupPeer);
   writer.writeLong(2, this.rid);
   for (ApiUpdateOptimization i : this.optimizations) {
     writer.writeInt(3, i.getValue());
   }
 }
 @Override
 public void serialize(BserWriter writer) throws IOException {
   writer.writeInt(1, this.w);
   writer.writeInt(2, this.h);
   if (this.getUnmappedObjects() != null) {
     SparseArray<Object> unmapped = this.getUnmappedObjects();
     for (int i = 0; i < unmapped.size(); i++) {
       int key = unmapped.keyAt(i);
       writer.writeUnmapped(key, unmapped.get(key));
     }
   }
 }
 @Override
 public void serialize(BserWriter writer) throws IOException {
   writer.writeInt(1, this.bannerId);
   writer.writeInt(2, this.viewDuration);
 }
 @Override
 public void serialize(BserWriter writer) throws IOException {
   writer.writeInt(1, this.uid);
   writer.writeLong(2, this.accessHash);
 }
 @Override
 public void serialize(BserWriter writer) throws IOException {
   writer.writeInt(1, this.timeout);
 }