Java Doc for Util.java in  » Web-Server » Quadcap-Web-Server » com » quadcap » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Server » Quadcap Web Server » com.quadcap.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.quadcap.util.Util

Util
public class Util (Code)
This class aggregates a bunch of various string manipulation utilities.
author:
   Stan Bailes


Field Summary
public static  char[]hexMap
    
static  intlastTrace
    
static  HashMaptraces
    


Method Summary
public static  booleanboolProperty(String s)
    
public static  byte[]bytes(String s)
    
public static  byte[]bytes(int i)
    
public static  byte[]bytes(long i)
     Convert a long to a byte array, MSB first.
public static  voidbytesToChars(byte[] bbuf, int boff, char[] cbuf, int coff, int clen)
    
final public static  longbytesToLong(byte[] buf)
     Convert a byte array which represents a long into a long.
Parameters:
  buf - the byte array, MSB first.
final public static  longbytesToLong(byte[] buf, int offset)
     Convert a byte array which represents a long into a long.
Parameters:
  buf - the byte array, MSB first.
public static  voidcharsToBytes(char[] cbuf, int coff, byte[] bbuf, int boff, int clen)
    
public static  ObjectcheckCapacity(Object array, int desiredcap)
    
public static  intcompareBytes(byte[] k1, int s1, int c1, byte[] k2, int s2, int c2)
     Byte-array comparison.
public static  intcompareBytes(byte[] b1, byte[] b2)
    
public static  intcompareObjects(Object a, Object b)
    
public static  voidcopyStream(InputStream in, OutputStream out)
    
public static  intexecCommand(String cmd, OutputStream out, OutputStream err)
    
public static  intexecCommand(String[] cmdarray, OutputStream out, OutputStream err)
    
public static  intexecCommand(String cmd, OutputStream out)
    
public static  StringexecCommand(String cmd)
    
public static  StringexecCommand(String[] cmd)
    
public static  StringexecCommand(String a, String b)
    
public static  StringexecCommand(String a, String b, String c)
    
public static  StringgetStackTrace(Throwable t)
    
public static  StringhexBytes(byte[] buf)
    
public static  StringhexBytes(byte[] buf, int off, int len)
    
public static  StringhexInts(byte[] buf)
    
public static  StringhexInts(byte[] buf, int off, int len)
    
public static  StringhtmlEscape(String s)
    
public static  intintProperty(String s, int defVal)
    
public static  intinteger(byte[] buf)
     Convert a byte array which represents an integer into an integer.
Parameters:
  buf - the byte array, MSB first.
public static  intinteger(byte[] buf, int pos)
     Extract an integer from four bytes in a byte array.
final public static  voidjoin(Thread t)
     Utility to join without having to worry about catching InterruptedException.
public static  String[]listFiles(File f)
    
public static  ThreadmakeCopyThread(InputStream in, OutputStream out)
     Create a thread which copies bytes from an input stream to an output stream until end of file is reached.
public static  HashtableparseArgs(String args)
    
public static  ListparseIntList(String s)
     Parse a comma-separated list of integers or integer ranges.
final public static  PropertiesparsePropsString(String extraProps)
    
public static  voidputInt(byte[] buf, int pos, int val)
    
public static  voidputLong(byte[] buf, int pos, long val)
    
public static  StringreadFile(String filename)
    
final public static  voidsleep(long ms)
     Utility to sleep without having to worry about catching InterruptedException.
public static  Vectorsplit(String s, char delim)
     Split a string into a vector of elements.
public static  Vectorsplit(String s, char delim, int cnt)
    
public static  StringstackTrace()
     Return a string showing the current stack trace.
public static  StringstackTrace(boolean condense)
    
public static  StringstackTrace(Throwable e, boolean condense)
     Return a string showing the current stack trace.
public static  StringstrBytes(byte[] buf, int offset, int len)
    
public static  StringstrBytes(byte[] buf)
    
public static  byte[]strCharsAsBytes(String s)
    
public static  StringstrProperty(String s, String defVal)
    
public static  FileuserFile(String name)
     Return a File object corresponding to the specified file name. If the name is relative, it is located relative to the user's current directory.
public static  intwaitFor(Process p, OutputStream out, OutputStream err)
    
final public static  intwaitFor(Process p)
    

Field Detail
hexMap
public static char[] hexMap(Code)



lastTrace
static int lastTrace(Code)



traces
static HashMap traces(Code)





Method Detail
boolProperty
public static boolean boolProperty(String s)(Code)



bytes
public static byte[] bytes(String s)(Code)



bytes
public static byte[] bytes(int i)(Code)
Convert an int to a byte array, MSB first
Parameters:
  i - the int value



bytes
public static byte[] bytes(long i)(Code)
Convert a long to a byte array, MSB first.
Parameters:
  i - the long value



bytesToChars
public static void bytesToChars(byte[] bbuf, int boff, char[] cbuf, int coff, int clen)(Code)



bytesToLong
final public static long bytesToLong(byte[] buf)(Code)
Convert a byte array which represents a long into a long.
Parameters:
  buf - the byte array, MSB first. the long value stored in the byte array.



bytesToLong
final public static long bytesToLong(byte[] buf, int offset)(Code)
Convert a byte array which represents a long into a long.
Parameters:
  buf - the byte array, MSB first. the long value stored in the byte array.



charsToBytes
public static void charsToBytes(char[] cbuf, int coff, byte[] bbuf, int boff, int clen)(Code)



checkCapacity
public static Object checkCapacity(Object array, int desiredcap)(Code)
Generic array resizer



compareBytes
public static int compareBytes(byte[] k1, int s1, int c1, byte[] k2, int s2, int c2)(Code)
Byte-array comparison.
Parameters:
  k1 - the byte array containing key 1.
Parameters:
  s1 - the starting offset of key 1 in k1.
Parameters:
  c1 - the length of key 1.
Parameters:
  k2 - the byte array containing key 2.
Parameters:
  s2 - the starting offset of key 2 in k2.
Parameters:
  c2 - the length of key 2.

< zeroif key1 is less than key2
zeroif key1 is equal to key2
> zeroif key1 is greater than key2




compareBytes
public static int compareBytes(byte[] b1, byte[] b2)(Code)



compareObjects
public static int compareObjects(Object a, Object b)(Code)



copyStream
public static void copyStream(InputStream in, OutputStream out) throws IOException(Code)



execCommand
public static int execCommand(String cmd, OutputStream out, OutputStream err)(Code)



execCommand
public static int execCommand(String[] cmdarray, OutputStream out, OutputStream err)(Code)



execCommand
public static int execCommand(String cmd, OutputStream out)(Code)



execCommand
public static String execCommand(String cmd)(Code)



execCommand
public static String execCommand(String[] cmd)(Code)



execCommand
public static String execCommand(String a, String b)(Code)



execCommand
public static String execCommand(String a, String b, String c)(Code)



getStackTrace
public static String getStackTrace(Throwable t)(Code)



hexBytes
public static String hexBytes(byte[] buf)(Code)



hexBytes
public static String hexBytes(byte[] buf, int off, int len)(Code)



hexInts
public static String hexInts(byte[] buf)(Code)



hexInts
public static String hexInts(byte[] buf, int off, int len)(Code)



htmlEscape
public static String htmlEscape(String s)(Code)



intProperty
public static int intProperty(String s, int defVal)(Code)



integer
public static int integer(byte[] buf)(Code)
Convert a byte array which represents an integer into an integer.
Parameters:
  buf - the byte array, MSB first. the integer value stored in the byte array.



integer
public static int integer(byte[] buf, int pos)(Code)
Extract an integer from four bytes in a byte array.
Parameters:
  buf - the byte array
Parameters:
  pos - the offset in the array of the first (MSB) byte of the int the integer value stored in the byte array.



join
final public static void join(Thread t)(Code)
Utility to join without having to worry about catching InterruptedException.
Parameters:
  t - the thread to wait for



listFiles
public static String[] listFiles(File f)(Code)
Like File.list(), but returns directories first, and sorts alpha



makeCopyThread
public static Thread makeCopyThread(InputStream in, OutputStream out)(Code)
Create a thread which copies bytes from an input stream to an output stream until end of file is reached.



parseArgs
public static Hashtable parseArgs(String args)(Code)



parseIntList
public static List parseIntList(String s)(Code)
Parse a comma-separated list of integers or integer ranges. Example: 1,2 Example: 1,3-5,77 a List of Integers



parsePropsString
final public static Properties parsePropsString(String extraProps)(Code)
Parse a semicolon-separated property list: prop1=val1;prop2=val2



putInt
public static void putInt(byte[] buf, int pos, int val)(Code)



putLong
public static void putLong(byte[] buf, int pos, long val)(Code)



readFile
public static String readFile(String filename)(Code)



sleep
final public static void sleep(long ms)(Code)
Utility to sleep without having to worry about catching InterruptedException.
Parameters:
  ms - milliseconds to sleep.



split
public static Vector split(String s, char delim)(Code)
Split a string into a vector of elements.



split
public static Vector split(String s, char delim, int cnt)(Code)



stackTrace
public static String stackTrace()(Code)
Return a string showing the current stack trace.



stackTrace
public static String stackTrace(boolean condense)(Code)



stackTrace
public static String stackTrace(Throwable e, boolean condense)(Code)
Return a string showing the current stack trace.



strBytes
public static String strBytes(byte[] buf, int offset, int len)(Code)



strBytes
public static String strBytes(byte[] buf)(Code)



strCharsAsBytes
public static byte[] strCharsAsBytes(String s)(Code)
To hell with character encodings ;-)



strProperty
public static String strProperty(String s, String defVal)(Code)



userFile
public static File userFile(String name)(Code)
Return a File object corresponding to the specified file name. If the name is relative, it is located relative to the user's current directory. This is helpful for the case when we run as a service from the /winnt/system32 directory and want to open files relative to our install root.
Parameters:
  name - the file name the file



waitFor
public static int waitFor(Process p, OutputStream out, OutputStream err) throws IOException(Code)



waitFor
final public static int waitFor(Process p)(Code)
Utility to wait for a process without having to worry about catching InterruptedException
Parameters:
  p - the process to wait for



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.