com.sun.xml.fastinfoset.algorithm
Class BooleanEncodingAlgorithm

java.lang.Object
  extended by com.sun.xml.fastinfoset.algorithm.BuiltInEncodingAlgorithm
      extended by com.sun.xml.fastinfoset.algorithm.BooleanEncodingAlgorithm
All Implemented Interfaces:
EncodingAlgorithm

public class BooleanEncodingAlgorithm
extends BuiltInEncodingAlgorithm

An encoder for handling boolean values. Suppports the builtin BOOLEAN encoder.

Author:
Alan Hudson, Paul Sandoz

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.xml.fastinfoset.algorithm.BuiltInEncodingAlgorithm
BuiltInEncodingAlgorithm.WordListener
 
Field Summary
 
Fields inherited from class com.sun.xml.fastinfoset.algorithm.BuiltInEncodingAlgorithm
SPACE_PATTERN
 
Constructor Summary
BooleanEncodingAlgorithm()
           
 
Method Summary
 java.lang.Object convertFromCharacters(char[] ch, int start, int length)
           
 void convertToCharacters(java.lang.Object data, java.lang.StringBuffer s)
           
 java.lang.Object decodeFromBytes(byte[] b, int start, int length)
           
 void decodeFromBytesToBooleanArray(boolean[] bdata, int bstart, int blength, byte[] b, int start, int length)
           
 java.lang.Object decodeFromInputStream(java.io.InputStream s)
           
 void encodeToBytes(java.lang.Object array, int astart, int alength, byte[] b, int start)
           
 void encodeToBytesFromBooleanArray(boolean[] array, int astart, int alength, byte[] b, int start)
           
 void encodeToOutputStream(java.lang.Object data, java.io.OutputStream s)
           
 int getOctetLengthFromPrimitiveLength(int primitiveLength)
           
 int getPrimtiveLengthFromOctetLength(int octetLength)
           
 int getPrimtiveLengthFromOctetLength(int octetLength, int firstOctet)
           
 
Methods inherited from class com.sun.xml.fastinfoset.algorithm.BuiltInEncodingAlgorithm
matchWhiteSpaceDelimnatedWords, removeWhitespace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BooleanEncodingAlgorithm

public BooleanEncodingAlgorithm()
Method Detail

getPrimtiveLengthFromOctetLength

public int getPrimtiveLengthFromOctetLength(int octetLength)
                                     throws EncodingAlgorithmException
Specified by:
getPrimtiveLengthFromOctetLength in class BuiltInEncodingAlgorithm
Throws:
EncodingAlgorithmException

getOctetLengthFromPrimitiveLength

public int getOctetLengthFromPrimitiveLength(int primitiveLength)
Specified by:
getOctetLengthFromPrimitiveLength in class BuiltInEncodingAlgorithm

decodeFromBytes

public final java.lang.Object decodeFromBytes(byte[] b,
                                              int start,
                                              int length)
                                       throws EncodingAlgorithmException
Throws:
EncodingAlgorithmException

decodeFromInputStream

public final java.lang.Object decodeFromInputStream(java.io.InputStream s)
                                             throws java.io.IOException
Throws:
java.io.IOException

encodeToOutputStream

public void encodeToOutputStream(java.lang.Object data,
                                 java.io.OutputStream s)
                          throws java.io.IOException
Throws:
java.io.IOException

convertFromCharacters

public final java.lang.Object convertFromCharacters(char[] ch,
                                                    int start,
                                                    int length)

convertToCharacters

public final void convertToCharacters(java.lang.Object data,
                                      java.lang.StringBuffer s)

getPrimtiveLengthFromOctetLength

public int getPrimtiveLengthFromOctetLength(int octetLength,
                                            int firstOctet)
                                     throws EncodingAlgorithmException
Throws:
EncodingAlgorithmException

decodeFromBytesToBooleanArray

public final void decodeFromBytesToBooleanArray(boolean[] bdata,
                                                int bstart,
                                                int blength,
                                                byte[] b,
                                                int start,
                                                int length)

encodeToBytes

public void encodeToBytes(java.lang.Object array,
                          int astart,
                          int alength,
                          byte[] b,
                          int start)
Specified by:
encodeToBytes in class BuiltInEncodingAlgorithm

encodeToBytesFromBooleanArray

public void encodeToBytesFromBooleanArray(boolean[] array,
                                          int astart,
                                          int alength,
                                          byte[] b,
                                          int start)