Java Doc for Bytes.java in  » Project-Management » turbine » org » apache » java » lang » 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 » Project Management » turbine » org.apache.java.lang 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.java.lang.Bytes

Bytes
public class Bytes (Code)
Static methods for managing byte arrays (all methods follow Big Endian order where most significant bits are in front).
author:
   Stefano Mazzocchi
version:
   $Id: Bytes.java 264148 2005-08-29 14:21:04Z henning $




Method Summary
public static  byte[]append(byte[] a, byte[] b)
     Appends two bytes array into one.
Parameters:
  a - A byte[].
Parameters:
  b - A byte[].
public static  byte[]append(byte[] a, byte[] b, byte[] c)
     Appends three bytes array into one.
Parameters:
  a - A byte[].
Parameters:
  b - A byte[].
Parameters:
  c - A byte[].
public static  booleanareEqual(byte[] a, byte[] b)
     Compares two byte arrays for equality.
Parameters:
  a - A byte[].
Parameters:
  b - A byte[].
public static  byte[]copy(byte[] b, int pos)
     Gets the end of the byte array given.
Parameters:
  b - A byte[].
Parameters:
  pos - The position from which to start.
public static  byte[]copy(byte[] b, int pos, int length)
     Gets a sub-set of the byte array given.
Parameters:
  b - A byte[].
Parameters:
  pos - The position from which to start.
Parameters:
  length - The number of bytes to copy from the originalbyte array to the new one.
public static  voidmerge(byte[] src, byte[] dest)
     Merges a bytes array into another.
public static  voidmerge(byte[] src, byte[] dest, int pos)
     Merges a bytes array into another starting from the given position.
public static  voidmerge(byte[] src, byte[] dest, int pos, int length)
     Merges a bytes array into another starting from the given position.
public static  voidmerge(byte[] src, byte[] dest, int srcpos, int destpos, int length)
     Merges a bytes array into another starting from the given positions.
public static  byte[]toBytes(int n)
     Returns a 4-byte array built from an int.
Parameters:
  n - The number to convert.
public static  byte[]toBytes(int n, byte[] b)
     Build a 4-byte array from an int.
public static  byte[]toBytes(long n)
     Returns a 8-byte array built from a long.
Parameters:
  n - The number to convert.
public static  byte[]toBytes(long n, byte[] b)
     Build a 8-byte array from a long.
public static  inttoInt(byte[] b)
     Build an int from first 4 bytes of the array.
Parameters:
  b - The byte[] to convert.
public static  longtoLong(byte[] b)
     Build a long from first 8 bytes of the array.
Parameters:
  b - The byte[] to convert.
public static  StringtoString(byte[] b)
     Returns a string of hexadecimal digits from a byte array.
Parameters:
  b - The byte[] to convert.
public static  StringtoString(byte[] b, int offset, int length)
     Returns a string of hexadecimal digits from a byte array, starting at offset and continuing for length bytes.
Parameters:
  b - The byte[] to convert.
Parameters:
  offset - An int.
Parameters:
  length - An int.



Method Detail
append
public static byte[] append(byte[] a, byte[] b)(Code)
Appends two bytes array into one.
Parameters:
  a - A byte[].
Parameters:
  b - A byte[]. A byte[].



append
public static byte[] append(byte[] a, byte[] b, byte[] c)(Code)
Appends three bytes array into one.
Parameters:
  a - A byte[].
Parameters:
  b - A byte[].
Parameters:
  c - A byte[]. A byte[].



areEqual
public static boolean areEqual(byte[] a, byte[] b)(Code)
Compares two byte arrays for equality.
Parameters:
  a - A byte[].
Parameters:
  b - A byte[]. True if the arrays have identical contents.



copy
public static byte[] copy(byte[] b, int pos)(Code)
Gets the end of the byte array given.
Parameters:
  b - A byte[].
Parameters:
  pos - The position from which to start. A byte[] consisting of the portion of b between pos andthe end of b.



copy
public static byte[] copy(byte[] b, int pos, int length)(Code)
Gets a sub-set of the byte array given.
Parameters:
  b - A byte[].
Parameters:
  pos - The position from which to start.
Parameters:
  length - The number of bytes to copy from the originalbyte array to the new one. A byte[] consisting of the portion of b starting at posand continuing for length bytes, or until the end of b isreached, which ever occurs first.



merge
public static void merge(byte[] src, byte[] dest)(Code)
Merges a bytes array into another.
Parameters:
  src - A byte[].
Parameters:
  dest - A byte[].



merge
public static void merge(byte[] src, byte[] dest, int pos)(Code)
Merges a bytes array into another starting from the given position.
Parameters:
  src - A byte[].
Parameters:
  dest - A byte[].
Parameters:
  pos - The position from which to start.



merge
public static void merge(byte[] src, byte[] dest, int pos, int length)(Code)
Merges a bytes array into another starting from the given position.
Parameters:
  src - A byte[].
Parameters:
  dest - A byte[].
Parameters:
  pos - The position from which to start.
Parameters:
  length - The number of bytes to merge.



merge
public static void merge(byte[] src, byte[] dest, int srcpos, int destpos, int length)(Code)
Merges a bytes array into another starting from the given positions.
Parameters:
  src - A byte[].
Parameters:
  dest - A byte[].
Parameters:
  srcpos - The position from which to start in src.
Parameters:
  destpos - The position from which to start in dest.
Parameters:
  length - The number of bytes to merge.



toBytes
public static byte[] toBytes(int n)(Code)
Returns a 4-byte array built from an int.
Parameters:
  n - The number to convert. A byte[].



toBytes
public static byte[] toBytes(int n, byte[] b)(Code)
Build a 4-byte array from an int. No check is performed on the array length.
Parameters:
  n - The number to convert.
Parameters:
  b - The array to fill. A byte[].



toBytes
public static byte[] toBytes(long n)(Code)
Returns a 8-byte array built from a long.
Parameters:
  n - The number to convert. A byte[].



toBytes
public static byte[] toBytes(long n, byte[] b)(Code)
Build a 8-byte array from a long. No check is performed on the array length.
Parameters:
  n - The number to convert.
Parameters:
  b - The array to fill. A byte[].



toInt
public static int toInt(byte[] b)(Code)
Build an int from first 4 bytes of the array.
Parameters:
  b - The byte[] to convert. An int.



toLong
public static long toLong(byte[] b)(Code)
Build a long from first 8 bytes of the array.
Parameters:
  b - The byte[] to convert. A long.



toString
public static String toString(byte[] b)(Code)
Returns a string of hexadecimal digits from a byte array.
Parameters:
  b - The byte[] to convert. A String.



toString
public static String toString(byte[] b, int offset, int length)(Code)
Returns a string of hexadecimal digits from a byte array, starting at offset and continuing for length bytes.
Parameters:
  b - The byte[] to convert.
Parameters:
  offset - An int.
Parameters:
  length - An int. A String.



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.