net.jqhome.jwps.ea
Class ByteArrayEA

java.lang.Object
  |
  +--net.jqhome.jwps.ea.AbstractEA
        |
        +--net.jqhome.jwps.ea.ByteArrayEA
Direct Known Subclasses:
BadEA, IconEA, OpenedFolderIconEA

public class ByteArrayEA
extends AbstractEA

An EA whose value is an array of bytes.


Field Summary
 
Fields inherited from class net.jqhome.jwps.ea.AbstractEA
EA_NAME_ASSOCIATION_TABLE, EA_NAME_CODEPAGE, EA_NAME_COMMENTS, EA_NAME_HISTORY, EA_NAME_ICON, EA_NAME_ICON1, EA_NAME_KEYPHRASES, EA_NAME_LONGNAME, EA_NAME_SUBJECT, EA_NAME_TYPE, EA_NAME_VERSION, XML_EA_B64_ENCODING, XML_EA_CODEPAGE_TAGNAME, XML_EA_ENCODING_TYPE_TAGNAME, XML_EA_FILE_TAGNAME, XML_EA_IS_CRITICAL_TAGNAME, XML_EA_LIST_TAGNAME, XML_EA_NAME_TAGNAME, XML_EA_TAGNAME, XML_EA_TEXT_ENCODING, XML_EA_TYPE_TAGNAME, XML_EA_VALUE_TAGNAME
 
Constructor Summary
ByteArrayEA()
           
ByteArrayEA(RawEA rawEA)
           
ByteArrayEA(java.lang.String name)
           
ByteArrayEA(java.lang.String name, byte[] value)
           
ByteArrayEA(java.lang.String name, byte[] value, int type, boolean isCritical)
           
ByteArrayEA(java.lang.String name, byte[] value, int start, int length)
           
ByteArrayEA(java.lang.String name, int type)
          Sets a non-critical EA without value
ByteArrayEA(java.lang.String name, int type, boolean isCritical)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 void fromRawEA(RawEA rawEA)
          The byte stream that the C API returns is only slightly parsed before being put into a raw EA object.
 int getRawEASize()
          This returns the size of the raw EA item.
 byte[] getValue()
           
 void setValue(byte[] value)
           
 void setValue(java.io.File file)
          Reads in the value of a file and sets the value from that.
 RawEA toRawEA()
          This method will take the EA and turn it into a Raw EA, that is, one that is almost directly storable in OS2.
 java.lang.String toString()
           
 org.w3c.dom.Node toXML(org.w3c.dom.Node node)
          This method will serialize this EA as a node.
 int valueSize()
          This computes the total number of bytes in the actual value of this EA.
 
Methods inherited from class net.jqhome.jwps.ea.AbstractEA
fileToBytes, getName, getType, isCritical, isUserDefined, setCritical, setName, setType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ByteArrayEA

public ByteArrayEA(java.lang.String name,
                   int type,
                   boolean isCritical)
            throws JWPException

ByteArrayEA

public ByteArrayEA()
            throws JWPException

ByteArrayEA

public ByteArrayEA(java.lang.String name,
                   int type)
            throws JWPException
Sets a non-critical EA without value


ByteArrayEA

public ByteArrayEA(java.lang.String name)
            throws JWPException

ByteArrayEA

public ByteArrayEA(java.lang.String name,
                   byte[] value,
                   int type,
                   boolean isCritical)
            throws JWPException

ByteArrayEA

public ByteArrayEA(RawEA rawEA)
            throws JWPException

ByteArrayEA

public ByteArrayEA(java.lang.String name,
                   byte[] value)
            throws JWPException

ByteArrayEA

public ByteArrayEA(java.lang.String name,
                   byte[] value,
                   int start,
                   int length)
            throws JWPException
Method Detail

getValue

public byte[] getValue()

setValue

public void setValue(java.io.File file)
              throws JWPException
Reads in the value of a file and sets the value from that.

JWPException

setValue

public void setValue(byte[] value)
              throws JWPException
JWPException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

fromRawEA

public void fromRawEA(RawEA rawEA)
               throws JWPException
Description copied from class: AbstractEA
The byte stream that the C API returns is only slightly parsed before being put into a raw EA object. Java EA objects are created from these.

Specified by:
fromRawEA in class AbstractEA
JWPException

getRawEASize

public int getRawEASize()
Description copied from class: AbstractEA
This returns the size of the raw EA item.

Specified by:
getRawEASize in class AbstractEA

toRawEA

public RawEA toRawEA()
              throws JWPException
Description copied from class: AbstractEA
This method will take the EA and turn it into a Raw EA, that is, one that is almost directly storable in OS2. Since there are really only 4 formats that are used, for ascii, binary, mvmt and mvst as long as you extend one of these you should not have to concern yourself with the vagaries of writing one of these.

Specified by:
toRawEA in class AbstractEA
JWPException

valueSize

public int valueSize()
Description copied from class: AbstractEA
This computes the total number of bytes in the actual value of this EA. So for example, for a string EA that is just the length. This is not the same value as might be returned from issuing call to getEASize() in FileEA. This is because there are additional control bytes that the system requires.

Specified by:
valueSize in class AbstractEA

toXML

public org.w3c.dom.Node toXML(org.w3c.dom.Node node)
                       throws JWPException
Description copied from class: AbstractEA
This method will serialize this EA as a node.

Specified by:
toXML in class AbstractEA
JWPException