@HiveDecimalWritableVersionV2 public void setFromBigIntegerBytesAndScale( byte[] bigIntegerBytes, int offset, int length, int scale) { fastReset(); isSet = fastSetFromBigIntegerBytesAndScale(bigIntegerBytes, offset, length, scale); if (!isSet) { fastReset(); } }
/** * Standard Writable method that deserialize the fields of this object from a DataInput. * */ @HiveDecimalWritableVersionV1 @Override public void readFields(DataInput in) throws IOException { int scale = WritableUtils.readVInt(in); int byteArrayLen = WritableUtils.readVInt(in); byte[] bytes = new byte[byteArrayLen]; in.readFully(bytes); fastReset(); if (!fastSetFromBigIntegerBytesAndScale(bytes, 0, bytes.length, scale)) { throw new IOException("Couldn't convert decimal"); } isSet = true; }
/** * Set the writable's current value to the signed value from BigInteger bytes and a specified * scale. * <p> * Afterwards, the isSet() method will return true, unless conversion failed. * */ @HiveDecimalWritableVersionV2 public void setFromBigIntegerBytesAndScale(byte[] bigIntegerBytes, int scale) { fastReset(); isSet = fastSetFromBigIntegerBytesAndScale(bigIntegerBytes, 0, bigIntegerBytes.length, scale); if (!isSet) { fastReset(); } }
@HiveDecimalWritableVersionV2 public void setFromBigIntegerBytesAndScale( byte[] bigIntegerBytes, int offset, int length, int scale) { fastReset(); isSet = fastSetFromBigIntegerBytesAndScale(bigIntegerBytes, offset, length, scale); if (!isSet) { fastReset(); } }
/** * Standard Writable method that deserialize the fields of this object from a DataInput. * */ @HiveDecimalWritableVersionV1 @Override public void readFields(DataInput in) throws IOException { int scale = WritableUtils.readVInt(in); int byteArrayLen = WritableUtils.readVInt(in); byte[] bytes = new byte[byteArrayLen]; in.readFully(bytes); fastReset(); if (!fastSetFromBigIntegerBytesAndScale(bytes, 0, bytes.length, scale)) { throw new IOException("Couldn't convert decimal"); } isSet = true; }
/** * Set the writable's current value to the signed value from BigInteger bytes and a specified * scale. * <p> * Afterwards, the isSet() method will return true, unless conversion failed. * */ @HiveDecimalWritableVersionV2 public void setFromBigIntegerBytesAndScale(byte[] bigIntegerBytes, int scale) { fastReset(); isSet = fastSetFromBigIntegerBytesAndScale(bigIntegerBytes, 0, bigIntegerBytes.length, scale); if (!isSet) { fastReset(); } }