public class PacketPrinter extends java.lang.Object implements PacketListener
PacketPrinter is useful for debugging, when you want to see exactly what Mathematica is sending you. Here is how you might use it:
// ml is a KernelLink PacketListener stdoutPrinter = new PacketPrinter(System.out); ml.addPacketListener(stdoutPrinter);After the execution of the above code, the contents of all packets that arrive during calls to the KernelLink methods waitForAnswer(), discardAnswer(), or any of the "evaluateTo" set will be printed to System.out. No matter how many PacketListeners are registered, their monitoring of incoming packets will never interfere with any other packet-handling code in your program, so you can turn on and off this full packet tracing by just adding or removing the two lines above. No other changes whatsoever are required to your program.
|Constructor and Description|
Prints packets to System.out.
|Modifier and Type||Method and Description|
Invoked when a packet arrives on the link.
public PacketPrinter(java.io.PrintStream strm)
strm- the stream on which packets will be printed
J/Link is Copyright (c) 1999-2017, Wolfram Research, Inc. All rights reserved.