Thanks for the link. Very interesting
But unfourtanely there is only described the write Method. The Browse Feature in this class is fairly new..
Anyway - I refactored my code and now I get an output - but I read only the same record. How could I read the logstream record by record? Not even Block by Block. The documentation is not really helpful....
public class mtbr01 {
public static void main(String[] args) throws IOException {
try{
//Log Stream name
String logName="MTLOGGER.TEST.MTPPS";
byte[] buffer=new byte[1000000];
//get Timestamp
long unixTimestamp = Instant.now().getEpochSecond();
int bytesRead =0;
//Open and connect to LogStream (MTLOGGER.TEST.MTPPS)
ZLogstream zlogger = new ZLogstream(logName);
zlogger.browseStartSearch(false,unixTimestamp);
for(int i=0;i<10;i++){
bytesRead=zlogger.readSearch(unixTimestamp, buffer, 0);
String value = new String(buffer);
System.out.println("Satz Nummer"+i);
System.out.println(value);
}
}
catch(ZLogstreamException EX)
{
//Print out messages and return codes from the logger
System.err.println("System logger error message <" +EX.getMessage() + ">");
System.err.println("System logger ReturnCode/ReasonCode <"+ EX.getReturnCode() +"/" + EX.getReasonCode() +">");
System.err.println("System logger resource <" + EX.getLogstreamName() + ">");
//Print out Java stack trace
EX.printStackTrace();
return;
}
}
}