public void setByte(byte value) { setByte(bytes, start, value); }
public static void setTime(byte[] bytes, int start, long hour, long minute, long second, long timezoneHour, long timezoneMinute) { BytePointable.setByte(bytes, start + HOUR_OFFSET, (byte) hour); BytePointable.setByte(bytes, start + MINUTE_OFFSET, (byte) minute); IntegerPointable.setInteger(bytes, start + MILLISECOND_OFFSET, (byte) second); BytePointable.setByte(bytes, start + TIMEZONE_HOUR_OFFSET, (byte) timezoneHour); BytePointable.setByte(bytes, start + TIMEZONE_MINUTE_OFFSET, (byte) timezoneMinute); }
public static void setDate(byte[] bytes, int start, long year, long month, long day, long timezoneHour, long timezoneMinute) { ShortPointable.setShort(bytes, start + YEAR_OFFSET, (short) year); BytePointable.setByte(bytes, start + MONTH_OFFSET, (byte) month); BytePointable.setByte(bytes, start + DAY_OFFSET, (byte) day); BytePointable.setByte(bytes, start + TIMEZONE_HOUR_OFFSET, (byte) timezoneHour); BytePointable.setByte(bytes, start + TIMEZONE_MINUTE_OFFSET, (byte) timezoneMinute); }
public static void setDateTime(byte[] bytes, int start, long year, long month, long day, long hour, long minute, long milliSecond, long timezoneHour, long timezoneMinute) { ShortPointable.setShort(bytes, start + YEAR_OFFSET, (short) year); BytePointable.setByte(bytes, start + MONTH_OFFSET, (byte) month); BytePointable.setByte(bytes, start + DAY_OFFSET, (byte) day); BytePointable.setByte(bytes, start + HOUR_OFFSET, (byte) hour); BytePointable.setByte(bytes, start + MINUTE_OFFSET, (byte) minute); IntegerPointable.setInteger(bytes, start + MILLISECOND_OFFSET, (int) milliSecond); BytePointable.setByte(bytes, start + TIMEZONE_HOUR_OFFSET, (byte) timezoneHour); BytePointable.setByte(bytes, start + TIMEZONE_MINUTE_OFFSET, (byte) timezoneMinute); }
public byte preIncrement() { byte v = getByte(); ++v; setByte(v); return v; }
public byte postIncrement() { byte v = getByte(); byte ov = v++; setByte(v); return ov; }
@Override public void finish() throws IOException { byte header = 0; if (nsCount > 0) { header |= ElementNodePointable.NS_CHUNK_EXISTS_MASK; } if (attrCount > 0) { header |= ElementNodePointable.ATTRIBUTES_CHUNK_EXISTS_MASK; } if (childrenCount > 0) { header |= ElementNodePointable.CHILDREN_CHUNK_EXISTS_MASK; } BytePointable.setByte(mvs.getByteArray(), headerOffset, header); }
public void setDecimal(long value, byte decimalPlace) { BytePointable.setByte(bytes, start + DECIMAL_PLACE_OFFSET, decimalPlace); LongPointable.setLong(bytes, start + VALUE_OFFSET, value); normalize(); }
public static void normalize(byte[] bytes, int start) { byte decimalPlace = getDecimalPlace(bytes, start); long value = getDecimalValue(bytes, start); // Normalize the value and take off trailing zeros. while (value != 0 && value % 10 == 0) { value /= 10; --decimalPlace; } BytePointable.setByte(bytes, start + DECIMAL_PLACE_OFFSET, decimalPlace); LongPointable.setLong(bytes, start + VALUE_OFFSET, value); }