protected byte[] getSerializedValue(ObjectInspector fieldObjectInspector, Object value,
      ByteStream.Output output, ColumnMapping mapping) throws IOException {
    // Reset the buffer we're going to use
    output.reset();

    // Start by only serializing primitives as-is
    if (fieldObjectInspector.getCategory() == ObjectInspector.Category.PRIMITIVE) {
      writeSerializedPrimitive((PrimitiveObjectInspector) fieldObjectInspector, output, value,
          mapping.getEncoding());
    } else {
      // We only accept a struct, which means that we're already nested one level deep
      writeWithLevel(fieldObjectInspector, value, output, mapping, 2);
    }

    return output.toByteArray();
  }
Compute the serialized value from the given element and object inspectors. Based on the Hive
types, represented through the ObjectInspectors for the whole object and column within the
object, serialize the object appropriately.

@param fieldObjectInspector
         ObjectInspector for the column value being serialized
@param value
         The Object itself being serialized
@param output
         A temporary buffer to reduce object creation
@return The serialized bytes from the provided value.
@throws IOException
          An error occurred when performing IO to serialize the data
accumulo-handler/src/java/org/apache/hadoop/hive/accumulo/serde/AccumuloRowSerializer.java