@Override public String toString() { return id.name() + ":" + StringUtil.bytesToHexString(Arrays.copyOfRange(params, 0, Math.max(20, params.length))); }
@Override public String toString() { return id.name() + ":" + StringUtil.bytesToHexString(Arrays.copyOfRange(params, 0, Math.max(20, params.length))); }
private static String formatTagValue(final short tag, final Object value) { final String tagString = SAMTag.makeStringTag(tag); if (value == null || value instanceof String) { return tagString + ":Z:" + value; } else if (value instanceof Integer || value instanceof Long || value instanceof Short || value instanceof Byte) { return tagString + ":i:" + value; } else if (value instanceof Character) { return tagString + ":A:" + value; } else if (value instanceof Float) { return tagString + ":f:" + value; } else if (value instanceof byte[]) { return tagString + ":H:" + StringUtil.bytesToHexString((byte[]) value); } else { throw new RuntimeException("Unexpected value type for tag " + tagString + ": " + value + " of class " + value.getClass().getName()); } }
private static String formatTagValue(final short tag, final Object value) { final String tagString = SAMTag.makeStringTag(tag); if (value == null || value instanceof String) { return tagString + ":Z:" + value; } else if (value instanceof Integer || value instanceof Long || value instanceof Short || value instanceof Byte) { return tagString + ":i:" + value; } else if (value instanceof Character) { return tagString + ":A:" + value; } else if (value instanceof Float) { return tagString + ":f:" + value; } else if (value instanceof byte[]) { return tagString + ":H:" + StringUtil.bytesToHexString((byte[]) value); } else { throw new RuntimeException("Unexpected value type for tag " + tagString + ": " + value + " of class " + value.getClass().getName()); } }
private String formatTagValue(final short tag, final Object value) { final String tagString = SAMTagUtil.getSingleton().makeStringTag(tag); if (value == null || value instanceof String) { return tagString + ":Z:" + value; } else if (value instanceof Integer || value instanceof Long || value instanceof Short || value instanceof Byte) { return tagString + ":i:" + value; } else if (value instanceof Character) { return tagString + ":A:" + value; } else if (value instanceof Float) { return tagString + ":f:" + value; } else if (value instanceof byte[]) { return tagString + ":H:" + StringUtil.bytesToHexString((byte[]) value); } else { throw new RuntimeException("Unexpected value type for tag " + tagString + ": " + value + " of class " + value.getClass().getName()); } }
break; case 'H': s = StringUtil.bytesToHexString((byte[]) value); buffer.put(s.getBytes(charset)); buffer.put((byte) 0);
value = StringUtil.bytesToHexString((byte[])value); } else if (tagType == 'B') { value = getArrayType(value, false) + encodeArrayValue(value);
value = StringUtil.bytesToHexString((byte[])value); } else if (tagType == 'B') { value = getArrayType(value, false) + encodeArrayValue(value);
break; case 'H': s = StringUtil.bytesToHexString((byte[]) value); buffer.put(s.getBytes(charset)); buffer.put((byte) 0);
value = StringUtil.bytesToHexString((byte[])value); } else if (tagType == 'B') { value = getArrayType(value, false) + "," + encodeArrayValue(value);