GTSDecoder { public void dump(PrintWriter pw) { StringBuilder sb = new StringBuilder(" "); GTSHelper.encodeName(sb, this.getName()); sb.append("{"); boolean first = true; for (Entry<String,String> entry: this.getLabels().entrySet()) { if (!first) { sb.append(","); } GTSHelper.encodeName(sb, entry.getKey()); sb.append("="); GTSHelper.encodeName(sb, entry.getValue()); first = false; } sb.append("} "); String clslbs = sb.toString(); first = true; long l; while(this.next()) { if (!first) { pw.print("="); } pw.print(this.getTimestamp()); pw.print("/"); l = getLocation(); if (GeoTimeSerie.NO_LOCATION != l) { double[] latlon = GeoXPLib.fromGeoXPPoint(l); pw.print(latlon[0]); pw.print(":"); pw.print(latlon[1]); } pw.print("/"); l = getElevation(); if (GeoTimeSerie.NO_ELEVATION != l) { pw.print(l); } if (first) { pw.print(clslbs); first = false; } else { pw.print(" "); } sb.setLength(0); GTSHelper.encodeValue(sb, getBinaryValue()); pw.print(sb.toString()); pw.print("\r\n"); } } GTSDecoder(long baseTimestamp, ByteBuffer bb);  GTSDecoder(long baseTimestamp, byte[] key, ByteBuffer bb); boolean next(); long getTimestamp(); long getLocation(); long getElevation(); Object getValue(); boolean isBinary(); Object getBinaryValue(); GeoTimeSerie decode(TYPE type, boolean strict); GeoTimeSerie decode(TYPE type); GeoTimeSerie decode(); GTSEncoder getCompatibleEncoder(long basets); long getBaseTimestamp(); long getClassId(); void setClassId(long classId); long getLabelsId(); void setLabelsId(long labelsId); String getName(); void setName(String name); Map<String, String> getLabels(); void setLabels(Map<String, String> labels); void setLabel(String key, String value); void setMetadata(Metadata metadata); Metadata getMetadata(); GTSEncoder getEncoder(boolean safeMetadata); GTSEncoder getEncoder(); int getRemainingSize(); long getCount(); GTSDecoder dedup(); ByteBuffer getBuffer(); GTSDecoder duplicate(); void dump(PrintWriter pw); static GTSDecoder fromBlock(byte[] block, byte[] key);  }
@Test public void testDecoder_dump() throws Exception { GTSEncoder encoder = new GTSEncoder(0L); encoder.addValue(0L, 0L, 0L, false); encoder.addValue(1L, 0L, 0L, 1L); encoder.addValue(2L, 0L, 0L, 2.0D); encoder.addValue(3L, 0L, 0L, "3"); encoder.addValue(4L, 0L, 0L, "é".getBytes(StandardCharsets.ISO_8859_1)); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); GTSDecoder decoder = encoder.getDecoder(); decoder.dump(pw); pw.close(); Assert.assertEquals("0/-90.0:-180.0/0 {} F\r\n=1/-90.0:-180.0/0 1\r\n=2/-90.0:-180.0/0 2.0\r\n=3/-90.0:-180.0/0 '3'\r\n=4/-90.0:-180.0/0 b64:6Q\r\n", sw.toString()); }