}
private static int encodePrimitive(BerObject obj, Stack<ByteBuffer> components) throws Exception {
byte[] value = null;
if( obj instanceof BerBytes ) {
BerBytes berBytes = (BerBytes)obj;
value = berBytes.getValue();
} else if( obj instanceof BerInteger ) {
BerInteger berInt = (BerInteger)obj;
value = computeIntegerValue(berInt);