@Override
 public void serialize(BserWriter writer) throws IOException {
   writer.writeLong(1, this.fileId);
   writer.writeLong(2, this.accessHash);
   writer.writeInt(3, this.fileSize);
   if (this.name == null) {
     throw new IOException();
   }
   writer.writeString(4, this.name);
   if (this.mimeType == null) {
     throw new IOException();
   }
   writer.writeString(5, this.mimeType);
   if (this.thumb != null) {
     writer.writeObject(6, this.thumb);
   }
   if (this.ext != null) {
     writer.writeBytes(8, this.ext.buildContainer());
   }
   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 {
   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));
     }
   }
 }
예제 #3
0
 @Override
 public void serialize(BserWriter writer) throws IOException {
   writer.writeInt(1, this.w);
   writer.writeInt(2, this.h);
   if (this.thumb == null) {
     throw new IOException();
   }
   writer.writeBytes(3, this.thumb);
   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));
     }
   }
 }
예제 #4
0
 @Override
 public void serialize(BserWriter writer) throws IOException {
   if (this.text == null) {
     throw new IOException();
   }
   writer.writeString(1, this.text);
   writer.writeRepeatedInt(2, this.mentions);
   if (this.ext != null) {
     writer.writeBytes(3, this.ext.buildContainer());
   }
   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));
     }
   }
 }