1 9 package org.jrobin.core.jrrd; 10 11 import java.io.IOException ; 12 import java.io.PrintStream ; 13 14 20 public class CDPStatusBlock { 21 22 long offset; 23 long size; 24 int unknownDatapoints; 25 double value; 26 27 CDPStatusBlock(RRDFile file) throws IOException { 28 29 offset = file.getFilePointer(); 30 value = file.readDouble(); 31 unknownDatapoints = file.readInt(); 32 33 file.skipBytes(68); 35 36 size = file.getFilePointer() - offset; 37 } 38 39 44 public int getUnknownDatapoints() { 45 return unknownDatapoints; 46 } 47 48 53 public double getValue() { 54 return value; 55 } 56 57 void toXml(PrintStream s) { 58 59 s.print("\t\t\t<ds><value> "); 60 s.print(value); 61 s.print(" </value> <unknown_datapoints> "); 62 s.print(unknownDatapoints); 63 s.println(" </unknown_datapoints></ds>"); 64 } 65 66 71 public String toString() { 72 73 StringBuffer sb = new StringBuffer ("[CDPStatusBlock: OFFSET=0x"); 74 75 sb.append(Long.toHexString(offset)); 76 sb.append(", SIZE=0x"); 77 sb.append(Long.toHexString(size)); 78 sb.append(", unknownDatapoints="); 79 sb.append(unknownDatapoints); 80 sb.append(", value="); 81 sb.append(value); 82 sb.append("]"); 83 84 return sb.toString(); 85 } 86 } 87 | Popular Tags |