Example #1
0
 @Override
 public void encode(Object[] value, OutputStream outStream, Context context)
     throws CoderException, IOException {
   checkArgument(value.length == codersCount);
   Context nestedContext = context.nested();
   for (int i = 0; i < codersCount; ++i) {
     coders.get(i).encode(value[i], outStream, nestedContext);
   }
 }
Example #2
0
 @Override
 public Object[] decode(InputStream inStream, Context context)
     throws CoderException, IOException {
   Object[] ret = new Object[codersCount];
   Context nestedContext = context.nested();
   for (int i = 0; i < codersCount; ++i) {
     ret[i] = coders.get(i).decode(inStream, nestedContext);
   }
   return ret;
 }