Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

java.net
Class D  view D download D.java

java.lang.Object
  extended byjava.net.D

public class D
extends java.lang.Object

This is an utility class that provide an output method useful to print debug information. The usefulness is that it is driven by a global property: if you specify -Ddebug=true on the command line, the method D.p 55 prints the string otherwise it does nothing.

Version:
1.0

Field Summary
(package private) static boolean isDebug
           
 
Constructor Summary
D()
           
 
Method Summary
(package private) static void check(byte[] buf, int len)
          This utility method checks the passed buffer for negative length or for total zeroed content.
(package private) static void p(java.lang.String str)
          Use this method to print string to standard output based on the value of the global property debug.
(package private) static byte[] readFile(java.lang.String name)
          This utility method entirely reads a file and returns the content as a byte array.
(package private) static void writeFile(java.lang.String name, byte[] buf)
          This utility method entirely writes a byte array to a named file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isDebug

static boolean isDebug
Constructor Detail

D

public D()
Method Detail

p

static void p(java.lang.String str)
Use this method to print string to standard output based on the value of the global property debug.


readFile

static byte[] readFile(java.lang.String name)
This utility method entirely reads a file and returns the content as a byte array.


writeFile

static void writeFile(java.lang.String name,
                      byte[] buf)
This utility method entirely writes a byte array to a named file.


check

static void check(byte[] buf,
                  int len)
This utility method checks the passed buffer for negative length or for total zeroed content.