Return the column name byte buffer for this entity

@param obj
@return
495728
private ByteBuffer toColumnName(Object obj) {
        SimpleCompositeBuilder composite = new SimpleCompositeBuilder(bufferSize, Equality.EQUAL);

        // Iterate through each component and add to a CompositeType structure
        for (FieldMapper<?> mapper : components) {
            try {
                composite.addWithoutControl(mapper.toByteBuffer(obj));
            }
            catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
        return composite.get();
    }
336416
public static String objDesc(Object object) {
        return object == null ? "null" : (object.getClass().getName()+'@'+Integer.toHexString(object.hashCode()));
    }
263381
public static byte[] toByteArrayKryo(Object obj, ClassLoader classLoader) {
        if (obj == null) {
            return null;
        }
        Kryo kryo = kryoPool.obtain();
        try {
            ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
            if (classLoader != null) {
                Thread.currentThread().setContextClassLoader(classLoader);
            }
            try {
                Output output = kryoOutputPool.obtain();
                try {
                    kryo.setClassLoader(classLoader != null ? classLoader : oldClassLoader);
                    // kryo.writeObject(output, obj);
                    kryo.writeClassAndObject(output, obj);
                    output.close();
                    return output.toBytes();
                } catch (Exception e) {
                    throw e instanceof SerializationException ? (SerializationException) e
                            : new SerializationException(e);
                } finally {
                    kryoOutputPool.free(output);
                }
            } finally {
                Thread.currentThread().setContextClassLoader(oldClassLoader);
            }
        } finally {
            kryoPool.free(kryo);
        }
    }
1048216
public byte[] getBytes(int columnIndex) {
		Object fieldValue = data[columnIndex];
		if (fieldValue == null) {
			return null;
		}
		if (fieldValue instanceof byte[]) {
			return (byte[]) fieldValue;
		}
		throw new DBFException("Unsupported type for byte[] at column:" + columnIndex + " "
				+ fieldValue.getClass().getCanonicalName());
	}
355114
public String objectToString(Object obj)
    {
        String string = super.objectToString(obj);
        string = Base64.encode(string);
        return string;
    }
1049349
public static String simpleTypeName(Object obj) {
        if (obj == null) {
            return "null";
        }

        return simpleTypeName(obj.getClass(), false);
    }
96062
protected ByteBuffer objToBB(Object o)
    {
        if (o == null)
            return nullToBB();
        if (o instanceof java.lang.String)
            return ByteBuffer.wrap(new DataByteArray((String)o).get());
        if (o instanceof Integer)
            return Int32Type.instance.decompose((Integer)o);
        if (o instanceof Long)
            return LongType.instance.decompose((Long)o);
        if (o instanceof Float)
            return FloatType.instance.decompose((Float)o);
        if (o instanceof Double)
            return DoubleType.instance.decompose((Double)o);
        if (o instanceof UUID)
            return ByteBuffer.wrap(UUIDGen.decompose((UUID) o));
        if(o instanceof Tuple) {
            List<Object> objects = ((Tuple)o).getAll();
            //collections
            if (objects.size() > 0 && objects.get(0) instanceof String)
            {
                String collectionType = (String) objects.get(0);
                if ("set".equalsIgnoreCase(collectionType) ||
                        "list".equalsIgnoreCase(collectionType))
                    return objToListOrSetBB(objects.subList(1, objects.size()));
                else if ("map".equalsIgnoreCase(collectionType))
                    return objToMapBB(objects.subList(1, objects.size()));
                   
            }
            return objToCompositeBB(objects);
        }

        return ByteBuffer.wrap(((DataByteArray) o).get());
    }
1098637
private int getSerializationSize(final Object obj) {
		try {
			ByteArrayOutputStream bos = new ByteArrayOutputStream();
			ObjectOutputStream oos = new ObjectOutputStream(bos);
			oos.writeObject(obj);
			oos.close();

			byte[] bytes = bos.toByteArray();
			return bytes.length;
		} catch (IOException ex) {
			// Unable to serialize so cannot determine size.
			return -1;
		}
	}
453913
@Override
  public byte[] encode(final NamingUnregisterRequest obj) {
    final AvroNamingUnRegisterRequest result = AvroNamingUnRegisterRequest.newBuilder()
        .setId(obj.getIdentifier().toString())
        .build();
    return AvroUtils.toBytes(result, AvroNamingUnRegisterRequest.class);
  }
90539
public static byte[] serialize(Object object) {
		
		byte[] result = null;
		
		if (object == null) {
			return new byte[0];
		}
		try {
			ByteArrayOutputStream byteStream = new ByteArrayOutputStream(128);
			try  {
				if (!(object instanceof Serializable)) {
					throw new IllegalArgumentException(SerializeUtils.class.getSimpleName() + " requires a Serializable payload " +
							"but received an object of type [" + object.getClass().getName() + "]");
				}
				ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteStream);
				objectOutputStream.writeObject(object);
				objectOutputStream.flush();
				result =  byteStream.toByteArray();
			}
			catch (Throwable ex) {
				throw new Exception("Failed to serialize", ex);
			}
		} catch (Exception ex) {
			logger.error("Failed to serialize",ex);
		}
		return result;
	}
534138
@Override
    public byte[] getBytes(int columnIndex) throws SQLException {
        checkColumnBounds(columnIndex);
        try {
            if (table.getColumnType(columnIndex - 1) == VoltType.STRING)
                return table.getStringAsBytes(columnIndex - 1);
            else if (table.getColumnType(columnIndex - 1) == VoltType.VARBINARY)
                return table.getVarbinary(columnIndex - 1);
            else
                throw SQLError.get(SQLError.CONVERSION_NOT_FOUND,
                        table.getColumnType(columnIndex - 1), "byte[]");
        } catch (SQLException x) {
            throw x;
        } catch (Exception x) {
            throw SQLError.get(x);
        }
    }
1261585
public static byte[] serialize(Object obj) {
        try(ByteArrayOutputStream bos = new ByteArrayOutputStream();
            ObjectOutputStream oos = new ObjectOutputStream(bos)) {
            oos.writeObject(obj);
            return bos.toByteArray();
        } 
        catch (IOException ex) {
            throw new UncheckedIOException(ex);
        }
    }
606130
@Override
  public byte[] encode(final NamingLookupRequest obj) {
    final List<CharSequence> ids = new ArrayList<>();
    for (final Identifier id : obj.getIdentifiers()) {
      ids.add(id.toString());
    }
    return AvroUtils.toBytes(AvroNamingLookupRequest.newBuilder().setIds(ids).build(), AvroNamingLookupRequest.class);
  }
495061
public static byte[] getBlobColumn(final ResultSet rs, final String columnName) throws SQLException {
		try {
			final Blob blob = rs.getBlob(columnName);
			if (blob == null) {
				return null;
			}

			final InputStream is = blob.getBinaryStream();
			final ByteArrayOutputStream bos = new ByteArrayOutputStream();

			if (is == null) {
				return null;
			} else {
				final byte buffer[] = new byte[64];
				int c = is.read(buffer);
				while (c > 0) {
					bos.write(buffer, 0, c);
					c = is.read(buffer);
				}
				return bos.toByteArray();
			}
		} catch (final IOException e) {
			throw new SQLException("Failed to read BLOB column due to IOException: " + e.getMessage());
		}
	}
384036
def PyobjColumns(obj):
    ''
    return [ColumnAttr(k, type(getattr(obj, k))) for k in getPublicAttrs(obj)]
374258
@Override
    public Blob getBlob(int columnIndex) throws SQLException {
        checkColumnBounds(columnIndex);
        try {
            return new SerialBlob(table.getStringAsBytes(columnIndex - 1));
        } catch (Exception x) {
            throw SQLError.get(x);
        }
    }
482018
protected String canonicalName(EObject object) {
		if (object instanceof JvmIdentifiableElement) {
			return ((JvmIdentifiableElement) object).getQualifiedName();
		}
		final EObject jvmElement = this.associations.getPrimaryJvmElement(object);
		if (jvmElement instanceof JvmIdentifiableElement) {
			return ((JvmIdentifiableElement) jvmElement).getQualifiedName();
		}
		return null;
	}