use of com.navercorp.pinpoint.common.buffer.Buffer in project pinpoint by naver.
the class AnnotationTranscoder method decodeIntStringStringValue.
private Object decodeIntStringStringValue(byte[] data) {
final Buffer buffer = new FixedBuffer(data);
final int intValue = buffer.readSVInt();
final String stringValue1 = BytesUtils.toString(buffer.readPrefixedBytes());
final String stringValue2 = BytesUtils.toString(buffer.readPrefixedBytes());
return new IntStringStringValue(intValue, stringValue1, stringValue2);
}
use of com.navercorp.pinpoint.common.buffer.Buffer in project pinpoint by naver.
the class AnnotationTranscoder method decodeIntStringValue.
private Object decodeIntStringValue(byte[] data) {
final Buffer buffer = new FixedBuffer(data);
final int intValue = buffer.readSVInt();
final String stringValue = BytesUtils.toString(buffer.readPrefixedBytes());
return new IntStringValue(intValue, stringValue);
}
use of com.navercorp.pinpoint.common.buffer.Buffer in project pinpoint by naver.
the class AnnotationTranscoder method encodeIntStringValue.
private byte[] encodeIntStringValue(Object value) {
final IntStringValue tIntStringValue = (IntStringValue) value;
final int intValue = tIntStringValue.getIntValue();
final byte[] stringValue = BytesUtils.toBytes(tIntStringValue.getStringValue());
// TODO increase by a more precise value
final int bufferSize = getBufferSize(stringValue, 4 + 8);
final Buffer buffer = new AutomaticBuffer(bufferSize);
buffer.putSVInt(intValue);
buffer.putPrefixedBytes(stringValue);
return buffer.getBuffer();
}
use of com.navercorp.pinpoint.common.buffer.Buffer in project pinpoint by naver.
the class AnnotationTranscoder method encodeStringStringValue.
private byte[] encodeStringStringValue(Object o) {
final StringStringValue tStringStringValue = (StringStringValue) o;
final byte[] stringValue1 = BytesUtils.toBytes(tStringStringValue.getStringValue1());
final byte[] stringValue2 = BytesUtils.toBytes(tStringStringValue.getStringValue2());
// TODO increase by a more precise value
final int bufferSize = getBufferSize(stringValue1, stringValue2);
final Buffer buffer = new AutomaticBuffer(bufferSize);
buffer.putPrefixedBytes(stringValue1);
buffer.putPrefixedBytes(stringValue2);
return buffer.getBuffer();
}
use of com.navercorp.pinpoint.common.buffer.Buffer in project pinpoint by naver.
the class AnnotationTranscoder method encodeIntBooleanIntBooleanValue.
private byte[] encodeIntBooleanIntBooleanValue(Object o) {
final IntBooleanIntBooleanValue value = (IntBooleanIntBooleanValue) o;
// int + int
final Buffer buffer = new AutomaticBuffer(8);
buffer.putVInt(value.getIntValue1());
buffer.putBoolean(value.isBooleanValue1());
buffer.putVInt(value.getIntValue2());
buffer.putBoolean(value.isBooleanValue2());
return buffer.getBuffer();
}
Aggregations