Java Doc for Conversions.java in  » Profiler » JMeasurement » de » mcs » utils » 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 » Profiler » JMeasurement » de.mcs.utils 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   de.mcs.utils.Conversions

Conversions
final public class Conversions (Code)
This class encapsulates methods to deal with arrays of numbers, converting from numbers to bytes and bytes to numbers.

Methods xxxToByte() convert a Java array of primitive numbers (int, short, ...) to a Java array of bytes. Methods byteToXxx() convert from a Java array of bytes into a Java array of primitive numbers (int, short, ...)

Variant interfaces convert a section of an array, and also can convert to sub-classes of Java Number.





Method Summary
public static  byte[]byteToByte(byte data)
     Convert a single byte into an array of one byte.
public static  byte[]byteToByte(Byte data)
     Convert a single Byte object into an array of one byte.
public static  double[]byteToDouble(byte[] data)
     Convert an array of bytes into an array of double.
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong.
public static  double[]byteToDouble(int start, int len, byte[] data)
     Convert a range from an array of bytes into an array of double.
Parameters:
  start - The position in the input array of bytes to start
Parameters:
  len - The number of 'double' to convert
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong.
public static  doublebyteToDouble(byte[] data, int start)
     Convert 8 bytes from an array of bytes into a single double.
Parameters:
  start - The position in the input array of bytes to start
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong.
public static  float[]byteToFloat(byte[] data)
     Convert an array of bytes into an array of floats.
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong.
public static  float[]byteToFloat(int start, int len, byte[] data)
     Convert a range from an array of bytes into an array of float.
Parameters:
  start - The position in the input array of bytes to start
Parameters:
  len - The number of 'float' to convert
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong.
public static  floatbyteToFloat(byte[] data, int start)
     Convert 4 bytes from an array of bytes into a single float.
Parameters:
  start - The position in the input array of bytes to start
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong.
public static  int[]byteToInt(byte[] data)
     Convert an array of bytes into an array of ints.
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong.
public static  int[]byteToInt(int start, int len, byte[] data)
     Convert a range from an array of bytes into an array of int.
Parameters:
  start - The position in the input array of bytes to start
Parameters:
  len - The number of 'int' to convert
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong.
public static  intbyteToInt(byte[] data, int start)
     Convert 4 bytes from an array of bytes into a single int.
Parameters:
  start - The position in the input array of bytes to start
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong.
public static  long[]byteToLong(byte[] data)
     Convert an array of bytes into an array of long.
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong.
public static  long[]byteToLong(int start, int len, byte[] data)
     Convert a range from an array of bytes into an array of long.
Parameters:
  start - The position in the input array of bytes to start
Parameters:
  len - The number of 'long' to convert
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong.
public static  longbyteToLong(byte[] data, int start)
     Convert 8(?) bytes from an array of bytes into a single long.
Parameters:
  start - The position in the input array of bytes to start
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong.
public static  ObjectbyteToNumber(byte[] barray, Object obj)
     Create a Number object from an array of bytes.
Parameters:
  barray - The bytes to be converted
Parameters:
  obj - Input object of the desired output class.
public static  short[]byteToShort(byte[] data)
     Convert an array of bytes into an array of shorts.
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong.
public static  short[]byteToShort(int start, int len, byte[] data)
     Convert a range from an array of bytes into an array of short.
Parameters:
  start - The position in the input array of bytes to start
Parameters:
  len - The number of 'short' to convert
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong.
public static  shortbyteToShort(byte[] data, int start)
     Convert 2 bytes from an array of bytes into a single short.
Parameters:
  start - The position in the input array of bytes to start
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong.
public static  byte[]doubleToByte(int start, int len, double[] data)
     Convert a range from an array of double into an array of bytes.
Parameters:
  start - The position in the input array of double to start
Parameters:
  len - The number of 'double' to convert
Parameters:
  data - The input array of double
throws:
  ConversionException - if something goes wrong.
public static  byte[]doubleToByte(double data)
     Convert a single double into an array of 8 bytes.
public static  byte[]doubleToByte(Double data)
     Convert a single Double object into an array of 8 bytes.
public static  byte[]floatToByte(int start, int len, float[] data)
     Convert a range from an array of float into an array of bytes.
Parameters:
  start - The position in the input array of int to start
Parameters:
  len - The number of 'float' to convert
Parameters:
  data - The input array of float
throws:
  ConversionException - if something goes wrong.
public static  byte[]floatToByte(float data)
     Convert a single float into an array of 4 bytes.
public static  byte[]floatToByte(Float data)
     Convert a single Float object into an array of 4 bytes.
public static  byte[]intToByte(int start, int len, int[] data)
     Convert a range from an array of int into an array of bytes.
Parameters:
  start - The position in the input array of int to start
Parameters:
  len - The number of 'int' to convert
Parameters:
  data - The input array of int
throws:
  ConversionException - if something goes wrong.
public static  byte[]intToByte(int data)
     Convert a single int into an array of 4 bytes.
public static  byte[]intToByte(Integer data)
     Convert a single Integer object into an array of 4 bytes.
public static  byte[]longToByte(int start, int len, long[] data)
     Convert a range from an array of long into an array of bytes.
Parameters:
  start - The position in the input array of int to start
Parameters:
  len - The number of 'long' to convert
Parameters:
  data - The input array of long
throws:
  ConversionException - if something goes wrong.
public static  byte[]longToByte(long data)
     Convert a single long into an array of 8 bytes.
public static  byte[]longToByte(Long data)
     Convert a single Long object into an array of 8(?) bytes.
public static  byte[]shortToByte(int start, int len, short[] data)
     Convert a range from an array of short into an array of bytes.
Parameters:
  start - The position in the input array of int to start
Parameters:
  len - The number of 'short' to convert
Parameters:
  data - The input array of short
throws:
  ConversionException - if something goes wrong.
public static  byte[]shortToByte(short data)
     Convert a single short into an array of 2 bytes.
public static  byte[]shortToByte(Short data)
     Convert a single Short object into an array of 2 bytes.



Method Detail
byteToByte
public static byte[] byteToByte(byte data)(Code)
Convert a single byte into an array of one byte.

(This is a trivial method.)
Parameters:
  data - The input byte an array of bytes




byteToByte
public static byte[] byteToByte(Byte data)(Code)
Convert a single Byte object into an array of one byte.

(This is an almost trivial method.)
Parameters:
  data - The input Byte an array of bytes




byteToDouble
public static double[] byteToDouble(byte[] data) throws ConversionException(Code)
Convert an array of bytes into an array of double.
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong. an array of double



byteToDouble
public static double[] byteToDouble(int start, int len, byte[] data) throws ConversionException(Code)
Convert a range from an array of bytes into an array of double.
Parameters:
  start - The position in the input array of bytes to start
Parameters:
  len - The number of 'double' to convert
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong. an array of 'len' double



byteToDouble
public static double byteToDouble(byte[] data, int start) throws ConversionException(Code)
Convert 8 bytes from an array of bytes into a single double.
Parameters:
  start - The position in the input array of bytes to start
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong. The double value of the bytes.



byteToFloat
public static float[] byteToFloat(byte[] data) throws ConversionException(Code)
Convert an array of bytes into an array of floats.
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong. an array of float



byteToFloat
public static float[] byteToFloat(int start, int len, byte[] data) throws ConversionException(Code)
Convert a range from an array of bytes into an array of float.
Parameters:
  start - The position in the input array of bytes to start
Parameters:
  len - The number of 'float' to convert
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong. an array of 'len' float



byteToFloat
public static float byteToFloat(byte[] data, int start) throws ConversionException(Code)
Convert 4 bytes from an array of bytes into a single float.
Parameters:
  start - The position in the input array of bytes to start
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong. The float value of the bytes.



byteToInt
public static int[] byteToInt(byte[] data) throws ConversionException(Code)
Convert an array of bytes into an array of ints.
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong. an array of int



byteToInt
public static int[] byteToInt(int start, int len, byte[] data) throws ConversionException(Code)
Convert a range from an array of bytes into an array of int.
Parameters:
  start - The position in the input array of bytes to start
Parameters:
  len - The number of 'int' to convert
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong. an array of 'len' int



byteToInt
public static int byteToInt(byte[] data, int start) throws ConversionException(Code)
Convert 4 bytes from an array of bytes into a single int.
Parameters:
  start - The position in the input array of bytes to start
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong. The integer value of the bytes.



byteToLong
public static long[] byteToLong(byte[] data) throws ConversionException(Code)
Convert an array of bytes into an array of long.
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong. an array of long



byteToLong
public static long[] byteToLong(int start, int len, byte[] data) throws ConversionException(Code)
Convert a range from an array of bytes into an array of long.
Parameters:
  start - The position in the input array of bytes to start
Parameters:
  len - The number of 'long' to convert
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong. an array of 'len' long



byteToLong
public static long byteToLong(byte[] data, int start) throws ConversionException(Code)
Convert 8(?) bytes from an array of bytes into a single long.
Parameters:
  start - The position in the input array of bytes to start
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong. The long value of the bytes.



byteToNumber
public static Object byteToNumber(byte[] barray, Object obj) throws ConversionException(Code)
Create a Number object from an array of bytes.
Parameters:
  barray - The bytes to be converted
Parameters:
  obj - Input object of the desired output class. Must be a sub-classof Number. A Object of the type of obj.
throws:
  ConversionException - if something goes wrong.



byteToShort
public static short[] byteToShort(byte[] data) throws ConversionException(Code)
Convert an array of bytes into an array of shorts.
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong. an array of short



byteToShort
public static short[] byteToShort(int start, int len, byte[] data) throws ConversionException(Code)
Convert a range from an array of bytes into an array of short.
Parameters:
  start - The position in the input array of bytes to start
Parameters:
  len - The number of 'short' to convert
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong. an array of 'len' short



byteToShort
public static short byteToShort(byte[] data, int start) throws ConversionException(Code)
Convert 2 bytes from an array of bytes into a single short.
Parameters:
  start - The position in the input array of bytes to start
Parameters:
  data - The input array of bytes
throws:
  ConversionException - if something goes wrong. The short value of the bytes.



doubleToByte
public static byte[] doubleToByte(int start, int len, double[] data) throws ConversionException(Code)
Convert a range from an array of double into an array of bytes.
Parameters:
  start - The position in the input array of double to start
Parameters:
  len - The number of 'double' to convert
Parameters:
  data - The input array of double
throws:
  ConversionException - if something goes wrong. an array of bytes



doubleToByte
public static byte[] doubleToByte(double data)(Code)
Convert a single double into an array of 8 bytes.
Parameters:
  data - The input double an array of bytes



doubleToByte
public static byte[] doubleToByte(Double data)(Code)
Convert a single Double object into an array of 8 bytes.
Parameters:
  data - The input Double an array of bytes



floatToByte
public static byte[] floatToByte(int start, int len, float[] data) throws ConversionException(Code)
Convert a range from an array of float into an array of bytes.
Parameters:
  start - The position in the input array of int to start
Parameters:
  len - The number of 'float' to convert
Parameters:
  data - The input array of float
throws:
  ConversionException - if something goes wrong. an array of bytes



floatToByte
public static byte[] floatToByte(float data)(Code)
Convert a single float into an array of 4 bytes.
Parameters:
  data - The input float an array of bytes



floatToByte
public static byte[] floatToByte(Float data)(Code)
Convert a single Float object into an array of 4 bytes.
Parameters:
  data - The input Float an array of bytes



intToByte
public static byte[] intToByte(int start, int len, int[] data) throws ConversionException(Code)
Convert a range from an array of int into an array of bytes.
Parameters:
  start - The position in the input array of int to start
Parameters:
  len - The number of 'int' to convert
Parameters:
  data - The input array of int
throws:
  ConversionException - if something goes wrong. an array of bytes



intToByte
public static byte[] intToByte(int data)(Code)
Convert a single int into an array of 4 bytes.
Parameters:
  data - The input int an array of bytes



intToByte
public static byte[] intToByte(Integer data)(Code)
Convert a single Integer object into an array of 4 bytes.
Parameters:
  data - The input Integer an array of bytes



longToByte
public static byte[] longToByte(int start, int len, long[] data) throws ConversionException(Code)
Convert a range from an array of long into an array of bytes.
Parameters:
  start - The position in the input array of int to start
Parameters:
  len - The number of 'long' to convert
Parameters:
  data - The input array of long
throws:
  ConversionException - if something goes wrong. an array of bytes



longToByte
public static byte[] longToByte(long data)(Code)
Convert a single long into an array of 8 bytes.
Parameters:
  data - The input long an array of bytes



longToByte
public static byte[] longToByte(Long data)(Code)
Convert a single Long object into an array of 8(?) bytes.
Parameters:
  data - The input Long an array of bytes



shortToByte
public static byte[] shortToByte(int start, int len, short[] data) throws ConversionException(Code)
Convert a range from an array of short into an array of bytes.
Parameters:
  start - The position in the input array of int to start
Parameters:
  len - The number of 'short' to convert
Parameters:
  data - The input array of short
throws:
  ConversionException - if something goes wrong. an array of bytes



shortToByte
public static byte[] shortToByte(short data)(Code)
Convert a single short into an array of 2 bytes.
Parameters:
  data - The input short an array of bytes



shortToByte
public static byte[] shortToByte(Short data)(Code)
Convert a single Short object into an array of 2 bytes.
Parameters:
  data - The input Short an array of bytes



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.