Java Doc for Conversion.java in  » Net » Terracotta » com » tc » 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 » Net » Terracotta » com.tc.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.tc.util.Conversion

Conversion
public class Conversion (Code)
Data conversion algorithms and whatnot can be found in java.io.DataInput and java.io.DataOutput. Contains methods for converting from one kind of thing to another.
author:
   orion


Field Summary
final public static  longMAX_UINT
    
final public static  longMIN_UINT
    


Method Summary
public static  byteboolean2Byte(boolean value)
    
public static  byte[]boolean2Bytes(boolean v)
    
public static  Stringbuffer2String(int length, TCByteBuffer buffer)
    
public static  booleanbyte2Boolean(byte b)
    
public static  byte[]byte2Bytes(byte v)
    
public static  shortbyte2uint(byte b)
     Helper method to convert a byte to an unsigned int.
public static  booleanbytes2Boolean(byte[] bytes)
    
public static  charbytes2Char(byte[] bytes)
    
public static  doublebytes2Double(byte[] bytes)
    
public static  floatbytes2Float(byte[] bytes)
    
public static  intbytes2Int(byte[] bytes, int offset)
    
public static  intbytes2Int(byte[] bytes)
    
public static  longbytes2Long(byte[] bytes)
    
public static  longbytes2Long(byte[] bytes, int offset)
    
public static  shortbytes2Short(byte[] bytes)
    
public static  Stringbytes2String(byte[] bytes)
     Helper method to convert a string to bytes in a safe way.
public static  longbytes2uint(byte b)
    
public static  longbytes2uint(byte b, int length)
    
public static  longbytes2uint(byte b, int offset, int length)
    
public static  StringbytesToHex(byte[] b)
     Equivalent to calling bytesToHex(b, 0, b.length).
public static  StringbytesToHex(byte[] b, int index, int length)
     Converts a single byte to a hex string representation, can be decoded with Byte.parseByte().
public static  byte[]char2Bytes(char v)
    
public static  byte[]double2Bytes(double l)
    
public static  byte[]float2Bytes(float l)
    
public static  booleangetFlag(byte flags, int offset)
    
public static  byte[]hexToBytes(String hexString)
    
public static  byte[]int2Bytes(int v)
    
public static  byte[]long2Bytes(long l)
    
public static  bytesetFlag(byte flags, int offset, boolean value)
    
public static  byte[]short2Bytes(short v)
    
public static  byte[]string2Bytes(String string)
     Helper method to convert a string to bytes in a safe way.
public static  byte[]uint2bytes(long l)
    
public static  byte[]ushort2bytes(int i)
    
public static  voidwriteInt(int i, byte[] dest, int index)
    
public static  voidwriteLong(long l, byte[] rv, int offset)
    
public static  voidwriteUint(long l, byte[] dest, int index)
    

Field Detail
MAX_UINT
final public static long MAX_UINT(Code)



MIN_UINT
final public static long MIN_UINT(Code)





Method Detail
boolean2Byte
public static byte boolean2Byte(boolean value)(Code)

Parameters:
  value -



boolean2Bytes
public static byte[] boolean2Bytes(boolean v)(Code)



buffer2String
public static String buffer2String(int length, TCByteBuffer buffer)(Code)



byte2Boolean
public static boolean byte2Boolean(byte b)(Code)



byte2Bytes
public static byte[] byte2Bytes(byte v)(Code)



byte2uint
public static short byte2uint(byte b)(Code)
Helper method to convert a byte to an unsigned int. Use me when you want to treat a java byte as unsigned



bytes2Boolean
public static boolean bytes2Boolean(byte[] bytes)(Code)



bytes2Char
public static char bytes2Char(byte[] bytes)(Code)



bytes2Double
public static double bytes2Double(byte[] bytes)(Code)



bytes2Float
public static float bytes2Float(byte[] bytes)(Code)



bytes2Int
public static int bytes2Int(byte[] bytes, int offset)(Code)



bytes2Int
public static int bytes2Int(byte[] bytes)(Code)



bytes2Long
public static long bytes2Long(byte[] bytes)(Code)



bytes2Long
public static long bytes2Long(byte[] bytes, int offset)(Code)



bytes2Short
public static short bytes2Short(byte[] bytes)(Code)



bytes2String
public static String bytes2String(byte[] bytes)(Code)
Helper method to convert a string to bytes in a safe way.



bytes2uint
public static long bytes2uint(byte b)(Code)



bytes2uint
public static long bytes2uint(byte b, int length)(Code)



bytes2uint
public static long bytes2uint(byte b, int offset, int length)(Code)
Helper method to convert 1-4 bytes (big-endiand) into an unsigned int (max: 2^32 -1)



bytesToHex
public static String bytesToHex(byte[] b)(Code)
Equivalent to calling bytesToHex(b, 0, b.length).



bytesToHex
public static String bytesToHex(byte[] b, int index, int length)(Code)
Converts a single byte to a hex string representation, can be decoded with Byte.parseByte().
Parameters:
  b - the byte to encode a



char2Bytes
public static byte[] char2Bytes(char v)(Code)



double2Bytes
public static byte[] double2Bytes(double l)(Code)



float2Bytes
public static byte[] float2Bytes(float l)(Code)



getFlag
public static boolean getFlag(byte flags, int offset)(Code)



hexToBytes
public static byte[] hexToBytes(String hexString)(Code)

Parameters:
  hexString - an array of bytes, decoded from the hex-encoded string, if hexString is nullor the length is not a multiple of two then null is returned.



int2Bytes
public static byte[] int2Bytes(int v)(Code)



long2Bytes
public static byte[] long2Bytes(long l)(Code)



setFlag
public static byte setFlag(byte flags, int offset, boolean value)(Code)



short2Bytes
public static byte[] short2Bytes(short v)(Code)



string2Bytes
public static byte[] string2Bytes(String string)(Code)
Helper method to convert a string to bytes in a safe way.



uint2bytes
public static byte[] uint2bytes(long l)(Code)
Helper method to convert an unsigned integer to 4 bytes (big-endian)



ushort2bytes
public static byte[] ushort2bytes(int i)(Code)
Helper method to convert an unsigned short to 2 bytes (big-endian)



writeInt
public static void writeInt(int i, byte[] dest, int index)(Code)
Helper method to write a 4 byte java (signed) integer value into a given byte array at a given offset
Parameters:
  l - the signed int value to write
Parameters:
  dest - the byte array to write the uint into
Parameters:
  index - starting offset into the destination byte array



writeLong
public static void writeLong(long l, byte[] rv, int offset)(Code)



writeUint
public static void writeUint(long l, byte[] dest, int index)(Code)
Helper method to write a 4 byte unsigned integer value into a given byte array at a given offset
Parameters:
  l - the unsigned int value to write
Parameters:
  dest - the byte array to write the uint into
Parameters:
  index - starting offset into the destination byte array



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.