public void write(DataOutput out) throws IOException { checkBytes(); out.write(currentBytes, offset, getTotalLength()); }
/** * Used to create copies of objects * @return a copy of the internal TimestampWritableV2 byte[] */ public byte[] getBytes() { checkBytes(); int len = getTotalLength(); byte[] b = new byte[len]; System.arraycopy(currentBytes, offset, b, 0, len); return b; }
/** * @return length of serialized TimestampWritableV2 data. As a side effect, populates the internal * byte array if empty. */ int getTotalLength() { checkBytes(); return getTotalLength(currentBytes, offset); }
public void writeToByteStream(RandomAccessOutput byteStream) { checkBytes(); byteStream.write(currentBytes, offset, getTotalLength()); }
public int compareTo(TimestampWritableV2 t) { checkBytes(); long s1 = this.getSeconds(); long s2 = t.getSeconds(); if (s1 == s2) { int n1 = this.getNanos(); int n2 = t.getNanos(); if (n1 == n2) { return 0; } return n1 - n2; } else { return s1 < s2 ? -1 : 1; } }
/** * @return length of serialized TimestampWritableV2 data. As a side effect, populates the internal * byte array if empty. */ int getTotalLength() { checkBytes(); return getTotalLength(currentBytes, offset); }
/** * Used to create copies of objects * @return a copy of the internal TimestampWritableV2 byte[] */ public byte[] getBytes() { checkBytes(); int len = getTotalLength(); byte[] b = new byte[len]; System.arraycopy(currentBytes, offset, b, 0, len); return b; }
public void write(DataOutput out) throws IOException { checkBytes(); out.write(currentBytes, offset, getTotalLength()); }
public void writeToByteStream(RandomAccessOutput byteStream) { checkBytes(); byteStream.write(currentBytes, offset, getTotalLength()); }
public int compareTo(TimestampWritableV2 t) { checkBytes(); long s1 = this.getSeconds(); long s2 = t.getSeconds(); if (s1 == s2) { int n1 = this.getNanos(); int n2 = t.getNanos(); if (n1 == n2) { return 0; } return n1 - n2; } else { return s1 < s2 ? -1 : 1; } }