Java Doc for Box.java in  » 6.0-JDK-Modules » Java-Advanced-Imaging » com » sun » media » imageioimpl » plugins » jpeg2000 » 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 » 6.0 JDK Modules » Java Advanced Imaging » com.sun.media.imageioimpl.plugins.jpeg2000 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.media.imageioimpl.plugins.jpeg2000.Box

All known Subclasses:   com.sun.media.imageioimpl.plugins.jpeg2000.ChannelDefinitionBox,  com.sun.media.imageioimpl.plugins.jpeg2000.ComponentMappingBox,  com.sun.media.imageioimpl.plugins.jpeg2000.PaletteBox,  com.sun.media.imageioimpl.plugins.jpeg2000.FileTypeBox,  com.sun.media.imageioimpl.plugins.jpeg2000.DataEntryURLBox,  com.sun.media.imageioimpl.plugins.jpeg2000.HeaderBox,  com.sun.media.imageioimpl.plugins.jpeg2000.ResolutionBox,  com.sun.media.imageioimpl.plugins.jpeg2000.XMLBox,  com.sun.media.imageioimpl.plugins.jpeg2000.ColorSpecificationBox,  com.sun.media.imageioimpl.plugins.jpeg2000.BitsPerComponentBox,  com.sun.media.imageioimpl.plugins.jpeg2000.SignatureBox,  com.sun.media.imageioimpl.plugins.jpeg2000.UUIDListBox,  com.sun.media.imageioimpl.plugins.jpeg2000.UUIDBox,
Box
public class Box (Code)
This class is defined to create the box of JP2 file format. A box has a length, a type, an optional extra length and its content. The subclasses should explain the content information.


Field Summary
protected  byte[]data
    
protected  longextraLength
    
protected  intlength
    
protected  inttype
    

Constructor Summary
public  Box(int length, int type, byte[] data)
     Constructs a Box instance using the provided the box type and the box content in byte array format.
public  Box(int length, int type, long extraLength, byte[] data)
     Constructs a Box instance using the provided the box type, the box extra length, and the box content in byte array format.
public  Box(ImageInputStream iis, int pos)
     Constructs a Box instance from the provided ImageInputStream at the specified position.
public  Box(Node node)
     Constructs a Box from an "unknown" Node.

Method Summary
protected  voidcompose()
     Composes the content byte array from the data elements.
public static  voidcopyInt(byte[] data, int pos, int value)
     Copies that four bytes of an integer into the byte array.
public static  BoxcreateBox(int type, Node node)
     Creates a Box object with the provided type based on the provided Node object based on reflection.
public static  ObjectgetAttribute(Node node, String name)
     Extracts the value of the attribute from name.
public static  ClassgetBoxClass(int type)
     Returns the Box class for the box with the provided type.
protected static  byte[]getByteArrayElementValue(Node node)
     Gets the byte array from an IIOMetadataNode.
protected static  bytegetByteElementValue(Node node)
     Gets its byte value from an IIOMetadataNode.
public  byte[]getContent()
     Returns the box content in byte array.
public  longgetExtraLength()
     Returns the box extra length.
protected static  int[]getIntArrayElementValue(Node node)
     Gets the integer array from an IIOMetadataNode.
protected static  intgetIntElementValue(Node node)
     Gets its integer value from an IIOMetadataNode.
public  intgetLength()
     Returns the box length.
public static  StringgetName(int type)
     Returns the XML tag name defined in JP2 XML xsd/dtd for the box with the provided type.
public  IIOMetadataNodegetNativeNode()
     Creates an IIOMetadataNode from this box.
protected  IIOMetadataNodegetNativeNodeForSimpleBox()
     Creates an IIOMetadataNode from this box.
protected static  shortgetShortElementValue(Node node)
     Gets its short value from an IIOMetadataNode.
protected static  StringgetStringElementValue(Node node)
     Gets its String value from an IIOMetadataNode.
public  intgetType()
     Returns the box type.
public static  StringgetTypeByName(String name)
     Returns the type String based on the provided name.
public static  intgetTypeInt(String s)
     Converts the box type from integer to string.
public static  StringgetTypeString(int type)
     Converts the box type from integer to string.
protected  voidparse(byte[] data)
     Parses the data elements from the byte array.
public static  byte[]parseByteArray(String value)
     Parses the byte array expressed by a string.
protected static  int[]parseIntArray(String value)
     Parses the integer array expressed a string.
public  voidread(ImageInputStream iis, int pos)
     Reads a box from the ImageInputStream
public  voidsetContent(byte[] data)
     Sets the box content.
protected  voidsetDefaultAttributes(IIOMetadataNode node)
     Sets the default attributes, "Length", "Type", and "ExtraLength", to the provided IIOMetadataNode.
public  voidsetExtraLength(long extraLength)
     Sets the box extra length length to the provided value.
public  voidsetLength(int length)
     Sets the box length to the provided value.
public  voidwrite(ImageOutputStream ios)
     Writes this box instance into a ImageOutputStream.

Field Detail
data
protected byte[] data(Code)



extraLength
protected long extraLength(Code)



length
protected int length(Code)
Box length, extra length, type and content data array



type
protected int type(Code)




Constructor Detail
Box
public Box(int length, int type, byte[] data)(Code)
Constructs a Box instance using the provided the box type and the box content in byte array format.
Parameters:
  length - The provided box length.
Parameters:
  type - The provided box type.
Parameters:
  data - The provided box content in a byte array.
throws:
  IllegalArgumentException - If the length of the content byte arrayis not length - 8.



Box
public Box(int length, int type, long extraLength, byte[] data)(Code)
Constructs a Box instance using the provided the box type, the box extra length, and the box content in byte array format. In this case, the length of the box is set to 1, which indicates the extra length is meaningful.
Parameters:
  length - The provided box length.
Parameters:
  type - The provided box type.
Parameters:
  extraLength - The provided box extra length.
Parameters:
  data - The provided box content in a byte array.
throws:
  IllegalArgumentException - If the length of the content byte arrayis not extra length - 16.



Box
public Box(ImageInputStream iis, int pos) throws IOException(Code)
Constructs a Box instance from the provided ImageInputStream at the specified position.
Parameters:
  iis - The ImageInputStream contains the box.
Parameters:
  pos - The position from where to read the box.
throws:
  IOException - If any IOException is thrown in the called readmethods.



Box
public Box(Node node) throws IIOInvalidTreeException(Code)
Constructs a Box from an "unknown" Node. This node has at least the attribute "Type", and may have the attribute "Length", "ExtraLength" and a child "Content". The child node content is a IIOMetaDataNode with a byte[] user object.




Method Detail
compose
protected void compose()(Code)
Composes the content byte array from the data elements.



copyInt
public static void copyInt(byte[] data, int pos, int value)(Code)
Copies that four bytes of an integer into the byte array. Necessary for the subclasses to compose the content array from the data elements



createBox
public static Box createBox(int type, Node node) throws IIOInvalidTreeException(Code)
Creates a Box object with the provided type based on the provided Node object based on reflection.



getAttribute
public static Object getAttribute(Node node, String name)(Code)
Extracts the value of the attribute from name.



getBoxClass
public static Class getBoxClass(int type)(Code)
Returns the Box class for the box with the provided type.



getByteArrayElementValue
protected static byte[] getByteArrayElementValue(Node node)(Code)
Gets the byte array from an IIOMetadataNode.



getByteElementValue
protected static byte getByteElementValue(Node node)(Code)
Gets its byte value from an IIOMetadataNode.



getContent
public byte[] getContent()(Code)
Returns the box content in byte array.



getExtraLength
public long getExtraLength()(Code)
Returns the box extra length.



getIntArrayElementValue
protected static int[] getIntArrayElementValue(Node node)(Code)
Gets the integer array from an IIOMetadataNode.



getIntElementValue
protected static int getIntElementValue(Node node)(Code)
Gets its integer value from an IIOMetadataNode.



getLength
public int getLength()(Code)
Returns the box length.



getName
public static String getName(int type)(Code)
Returns the XML tag name defined in JP2 XML xsd/dtd for the box with the provided type. If the type is not known, the string "unknown" is returned.



getNativeNode
public IIOMetadataNode getNativeNode()(Code)
Creates an IIOMetadataNode from this box. The format of this node is defined in the XML dtd and xsd for the JP2 image file.



getNativeNodeForSimpleBox
protected IIOMetadataNode getNativeNodeForSimpleBox()(Code)
Creates an IIOMetadataNode from this box. The format of this node is defined in the XML dtd and xsd for the JP2 image file. This method is designed for the types of boxes whose XML tree only has 2 levels.



getShortElementValue
protected static short getShortElementValue(Node node)(Code)
Gets its short value from an IIOMetadataNode.



getStringElementValue
protected static String getStringElementValue(Node node)(Code)
Gets its String value from an IIOMetadataNode.



getType
public int getType()(Code)
Returns the box type.



getTypeByName
public static String getTypeByName(String name)(Code)
Returns the type String based on the provided name.



getTypeInt
public static int getTypeInt(String s)(Code)
Converts the box type from integer to string. This is necessary because type is defined as String in xsd/dtd and integer in the box classes.



getTypeString
public static String getTypeString(int type)(Code)
Converts the box type from integer to string. This is necessary because type is defined as String in xsd/dtd and integer in the box classes.



parse
protected void parse(byte[] data)(Code)
Parses the data elements from the byte array. The subclasses should override this method.



parseByteArray
public static byte[] parseByteArray(String value)(Code)
Parses the byte array expressed by a string.



parseIntArray
protected static int[] parseIntArray(String value)(Code)
Parses the integer array expressed a string.



read
public void read(ImageInputStream iis, int pos) throws IOException(Code)
Reads a box from the ImageInputStream



setContent
public void setContent(byte[] data)(Code)
Sets the box content. If the content length is not length -8 or extra length - 16, IllegalArgumentException will be thrown.



setDefaultAttributes
protected void setDefaultAttributes(IIOMetadataNode node)(Code)
Sets the default attributes, "Length", "Type", and "ExtraLength", to the provided IIOMetadataNode.



setExtraLength
public void setExtraLength(long extraLength)(Code)
Sets the box extra length length to the provided value.



setLength
public void setLength(int length)(Code)
Sets the box length to the provided value.



write
public void write(ImageOutputStream ios) throws IOException(Code)
Writes this box instance into a ImageOutputStream.



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.