/** * Prints an instant from milliseconds since 1970-01-01T00:00:00Z, * using ISO chronology in the default DateTimeZone. * * @param appendable the destination to format to, not null * @param instant millis since 1970-01-01T00:00:00Z * @since 2.0 */ public void printTo(Appendable appendable, long instant) throws IOException { printTo(appendable, instant, null); }
/** * Prints a ReadablePartial. * <p> * Neither the override chronology nor the override zone are used * by this method. * * @param out the destination to format to, not null * @param partial partial to format */ public void printTo(Writer out, ReadablePartial partial) throws IOException { printTo((Appendable) out, partial); }
/** * Prints a ReadableInstant, using the chronology supplied by the instant. * * @param out the destination to format to, not null * @param instant instant to format, null means now */ public void printTo(Writer out, ReadableInstant instant) throws IOException { printTo((Appendable) out, instant); }
/** * Prints a ReadableInstant, using the chronology supplied by the instant. * * @param buf the destination to format to, not null * @param instant instant to format, null means now */ public void printTo(StringBuffer buf, ReadableInstant instant) { try { printTo((Appendable) buf, instant); } catch (IOException ex) { // StringBuffer does not throw IOException } }
/** * Prints a ReadableInstant, using the chronology supplied by the instant. * * @param buf the destination to format to, not null * @param instant instant to format, null means now */ public void printTo(StringBuilder buf, ReadableInstant instant) { try { printTo((Appendable) buf, instant); } catch (IOException ex) { // StringBuilder does not throw IOException } }
/** * Prints a ReadableInstant, using the chronology supplied by the instant. * * @param out the destination to format to, not null * @param instant instant to format, null means now */ public void printTo(Writer out, ReadableInstant instant) throws IOException { printTo((Appendable) out, instant); }
/** * Prints an instant from milliseconds since 1970-01-01T00:00:00Z, * using ISO chronology in the default DateTimeZone. * * @param out the destination to format to, not null * @param instant millis since 1970-01-01T00:00:00Z */ public void printTo(Writer out, long instant) throws IOException { printTo((Appendable) out, instant); }
/** * Prints an instant from milliseconds since 1970-01-01T00:00:00Z, * using ISO chronology in the default DateTimeZone. * * @param out the destination to format to, not null * @param instant millis since 1970-01-01T00:00:00Z */ public void printTo(Writer out, long instant) throws IOException { printTo((Appendable) out, instant); }
/** * Prints an instant from milliseconds since 1970-01-01T00:00:00Z, * using ISO chronology in the default DateTimeZone. * * @param buf the destination to format to, not null * @param instant millis since 1970-01-01T00:00:00Z */ public void printTo(StringBuilder buf, long instant) { try { printTo((Appendable) buf, instant); } catch (IOException ex) { // StringBuilder does not throw IOException } }
/** * Prints a ReadablePartial. * <p> * Neither the override chronology nor the override zone are used * by this method. * * @param out the destination to format to, not null * @param partial partial to format */ public void printTo(Writer out, ReadablePartial partial) throws IOException { printTo((Appendable) out, partial); }
/** * Prints a ReadableInstant, using the chronology supplied by the instant. * * @param buf the destination to format to, not null * @param instant instant to format, null means now */ public void printTo(StringBuffer buf, ReadableInstant instant) { try { printTo((Appendable) buf, instant); } catch (IOException ex) { // StringBuffer does not throw IOException } }
/** * Prints a ReadableInstant, using the chronology supplied by the instant. * * @param buf the destination to format to, not null * @param instant instant to format, null means now */ public void printTo(StringBuilder buf, ReadableInstant instant) { try { printTo((Appendable) buf, instant); } catch (IOException ex) { // StringBuilder does not throw IOException } }
/** * Prints an instant from milliseconds since 1970-01-01T00:00:00Z, * using ISO chronology in the default DateTimeZone. * * @param appendable the destination to format to, not null * @param instant millis since 1970-01-01T00:00:00Z * @since 2.0 */ public void printTo(Appendable appendable, long instant) throws IOException { printTo(appendable, instant, null); }
/** * Prints an instant from milliseconds since 1970-01-01T00:00:00Z, * using ISO chronology in the default DateTimeZone. * * @param buf the destination to format to, not null * @param instant millis since 1970-01-01T00:00:00Z */ public void printTo(StringBuffer buf, long instant) { try { printTo((Appendable) buf, instant); } catch (IOException ex) { // StringBuffer does not throw IOException } }
/** * Prints a ReadablePartial. * <p> * Neither the override chronology nor the override zone are used * by this method. * * @param buf the destination to format to, not null * @param partial partial to format */ public void printTo(StringBuilder buf, ReadablePartial partial) { try { printTo((Appendable) buf, partial); } catch (IOException ex) { // StringBuilder does not throw IOException } }
@Override public void encodeValueInto(int depth, Block block, int position, SliceOutput output) { long millis = type.getLong(block, position); buffer.setLength(0); dateTimeFormatter.printTo(buffer, millis); for (int index = 0; index < buffer.length(); index++) { output.writeByte(buffer.charAt(index)); } }
private void encodeValue(Block block, int position, SliceOutput output) { long days = type.getLong(block, position); long millis = TimeUnit.DAYS.toMillis(days); buffer.setLength(0); HIVE_DATE_PARSER.printTo(buffer, millis); for (int index = 0; index < buffer.length(); index++) { output.writeByte(buffer.charAt(index)); } }
/** * Prints a ReadableInstant, using the chronology supplied by the instant. * * @param appendable the destination to format to, not null * @param instant instant to format, null means now * @since 2.0 */ public void printTo(Appendable appendable, ReadableInstant instant) throws IOException { long millis = DateTimeUtils.getInstantMillis(instant); Chronology chrono = DateTimeUtils.getInstantChronology(instant); printTo(appendable, millis, chrono); }
/** * Prints a ReadableInstant, using the chronology supplied by the instant. * * @param appendable the destination to format to, not null * @param instant instant to format, null means now * @since 2.0 */ public void printTo(Appendable appendable, ReadableInstant instant) throws IOException { long millis = DateTimeUtils.getInstantMillis(instant); Chronology chrono = DateTimeUtils.getInstantChronology(instant); printTo(appendable, millis, chrono); }
@Override public void encodeColumn(Block block, SliceOutput output, EncodeOutput encodeOutput) { for (int position = 0; position < block.getPositionCount(); position++) { if (block.isNull(position)) { output.writeBytes(nullSequence); } else { long millis = type.getLong(block, position); buffer.setLength(0); dateTimeFormatter.printTo(buffer, millis); for (int index = 0; index < buffer.length(); index++) { output.writeByte(buffer.charAt(index)); } } encodeOutput.closeEntry(); } }