/** * @param ctx Context. * @param arr Array. */ public BinaryEnumObjectImpl(BinaryContext ctx, byte[] arr) { assert ctx != null; assert arr != null; if (arr[0] == GridBinaryMarshaller.ENUM) valBytes = arr; else { assert arr[0] == GridBinaryMarshaller.BINARY_ENUM; valBytes = new byte[arr.length]; valBytes[0] = GridBinaryMarshaller.ENUM; U.arrayCopy(arr, 1, valBytes, 1, arr.length - 1); } this.ctx = ctx; int off = 1; this.typeId = BinaryPrimitives.readInt(arr, off); off += 4; if (this.typeId == GridBinaryMarshaller.UNREGISTERED_TYPE_ID) { assert arr[off] == GridBinaryMarshaller.STRING; int len = BinaryPrimitives.readInt(arr, ++off); off += 4; byte[] bytes = BinaryPrimitives.readByteArray(arr, off, len); off += len; this.clsName = new String(bytes, UTF_8); } this.ord = BinaryPrimitives.readInt(arr, off); }
byte[] data = BinaryPrimitives.readByteArray(ptr, fieldPos + 5, dataLen); byte[] data = BinaryPrimitives.readByteArray(ptr, fieldPos + 9, dataLen);
byte[] data = BinaryPrimitives.readByteArray(arr, fieldPos + 9, dataLen);
/** * @param ctx Context. * @param arr Array. */ public BinaryEnumObjectImpl(BinaryContext ctx, byte[] arr) { assert ctx != null; assert arr != null; if (arr[0] == GridBinaryMarshaller.ENUM) valBytes = arr; else { assert arr[0] == GridBinaryMarshaller.BINARY_ENUM; valBytes = new byte[arr.length]; valBytes[0] = GridBinaryMarshaller.ENUM; U.arrayCopy(arr, 1, valBytes, 1, arr.length - 1); } this.ctx = ctx; int off = 1; this.typeId = BinaryPrimitives.readInt(arr, off); off += 4; if (this.typeId == GridBinaryMarshaller.UNREGISTERED_TYPE_ID) { assert arr[off] == GridBinaryMarshaller.STRING; int len = BinaryPrimitives.readInt(arr, ++off); off += 4; byte[] bytes = BinaryPrimitives.readByteArray(arr, off, len); off += len; this.clsName = new String(bytes, UTF_8); } this.ord = BinaryPrimitives.readInt(arr, off); }
byte[] data = BinaryPrimitives.readByteArray(ptr, fieldPos + 5, dataLen); byte[] data = BinaryPrimitives.readByteArray(ptr, fieldPos + 9, dataLen);
byte[] data = BinaryPrimitives.readByteArray(arr, fieldPos + 9, dataLen);