com.ibm.diameter.packet
Class AvpValueUtilOctetString

java.lang.Object
  extended by com.ibm.diameter.packet.AvpValueUtil
      extended by com.ibm.diameter.packet.AvpValueUtilOctetString

public class AvpValueUtilOctetString
extends AvpValueUtil

Class used to hold the value of AVPs of type OctetString. An octet string is a byte array.


Constructor Summary
AvpValueUtilOctetString()
          Default constructor for the AvpValueUtilOctetString.
AvpValueUtilOctetString(byte[] value)
          Creates an instance of AvpValueUtilOctetString receiving the byte array.
 
Method Summary
 byte[] getAvpValue()
          Returns the byte array of data held by this AvpValueUtil.
 java.lang.Object getValue()
          Returns the AVP data.
 void getValueFromByteArray(byte[] in, int offset, int valueLength)
          Populates the AVP data field by reading the appropriate number of bytes from the supplied byte[]
 void getValueFromByteBuffer(com.ibm.wsspi.buffermgmt.WsByteBuffer in, int valueLength)
          Populates the AVP data field by reading the appropriate number of bytes from the WsByteBuffer
 void getValueFromByteBufferStream(com.ibm.diameter.util.DiamWsByteBufferInputStream in, int valueLength)
          Populates the AVP data field by reading the appropriate number of bytes from the supplied DiamWsByteBufferInputStream
 void getValueFromStream(java.io.DataInputStream in, int valueLength)
          Populates the AVP data field by reading the appropriate number of bytes from the DataInputStream
 int getValueLength()
          Returns the length of the AVP data field in octets.
 void setAvpValue(byte[] value)
          Sets the byte array of data held by this AvpValueUtil.
 void writeValueToByteBufferStream(com.ibm.diameter.util.DiamWsByteBufferOutputStream out)
          Writes the AVP data field to the DiamWsByteBufferInputStream
 void writeValueToStream(java.io.DataOutputStream out)
          Writes the AVP data field to the DataOutputStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AvpValueUtilOctetString

public AvpValueUtilOctetString()
Default constructor for the AvpValueUtilOctetString.


AvpValueUtilOctetString

public AvpValueUtilOctetString(byte[] value)
Creates an instance of AvpValueUtilOctetString receiving the byte array.

Parameters:
value - byte array of the data to be encapsulated by this AvpValueUtil.
Method Detail

getValueFromByteBuffer

public void getValueFromByteBuffer(com.ibm.wsspi.buffermgmt.WsByteBuffer in,
                                   int valueLength)
                            throws java.io.IOException,
                                   java.io.EOFException
Description copied from class: AvpValueUtil
Populates the AVP data field by reading the appropriate number of bytes from the WsByteBuffer

Overrides:
getValueFromByteBuffer in class AvpValueUtil
Parameters:
in - The WsByteBuffer that contains the AVP data.
valueLength - The number of bytes to read from the WsByteBuffer
Throws:
com.ibm.diameter.packet.exception.DataOutOfSyncException
java.io.IOException
java.io.EOFException

getValueFromByteArray

public void getValueFromByteArray(byte[] in,
                                  int offset,
                                  int valueLength)
                           throws java.io.IOException,
                                  java.io.EOFException,
                                  java.io.UnsupportedEncodingException
Description copied from class: AvpValueUtil
Populates the AVP data field by reading the appropriate number of bytes from the supplied byte[]

Overrides:
getValueFromByteArray in class AvpValueUtil
Parameters:
in - The byte[] that contains the AVP data.
offset - The position in the byte[] to be begin reading at
valueLength - The number of bytes to read from the byte[]
Throws:
com.ibm.diameter.packet.exception.DataOutOfSyncException
java.io.IOException
java.io.EOFException
java.io.UnsupportedEncodingException

getValueFromByteBufferStream

public void getValueFromByteBufferStream(com.ibm.diameter.util.DiamWsByteBufferInputStream in,
                                         int valueLength)
                                  throws java.io.IOException,
                                         java.io.EOFException
Description copied from class: AvpValueUtil
Populates the AVP data field by reading the appropriate number of bytes from the supplied DiamWsByteBufferInputStream

Overrides:
getValueFromByteBufferStream in class AvpValueUtil
Parameters:
in - The DiamWsByteBufferInputStream that contains the AVP data.
valueLength - The number of bytes to read from the DiamWsByteBufferInputStream
Throws:
com.ibm.diameter.packet.exception.DataOutOfSyncException
java.io.IOException
java.io.EOFException

writeValueToByteBufferStream

public void writeValueToByteBufferStream(com.ibm.diameter.util.DiamWsByteBufferOutputStream out)
                                  throws java.io.IOException
Description copied from class: AvpValueUtil
Writes the AVP data field to the DiamWsByteBufferInputStream

Overrides:
writeValueToByteBufferStream in class AvpValueUtil
Parameters:
out - The DiamWsByteBufferInputStream to write to
Throws:
java.io.IOException

getValueFromStream

public void getValueFromStream(java.io.DataInputStream in,
                               int valueLength)
                        throws java.io.IOException,
                               java.io.EOFException
Description copied from class: AvpValueUtil
Populates the AVP data field by reading the appropriate number of bytes from the DataInputStream

Overrides:
getValueFromStream in class AvpValueUtil
Parameters:
in - The DataInputStream that contains the AVP data.
valueLength - The number of bytes to read from the DataInputStream
Throws:
com.ibm.diameter.packet.exception.DataOutOfSyncException
java.io.IOException
java.io.EOFException

writeValueToStream

public void writeValueToStream(java.io.DataOutputStream out)
                        throws java.io.IOException
Description copied from class: AvpValueUtil
Writes the AVP data field to the DataOutputStream

Overrides:
writeValueToStream in class AvpValueUtil
Parameters:
out - The DataOutputStream to write to
Throws:
java.io.IOException

getValueLength

public int getValueLength()
Description copied from class: AvpValueUtil
Returns the length of the AVP data field in octets. Note that the length does not include any of the AVP header fields. It only applies to the length of the Avp data.

Overrides:
getValueLength in class AvpValueUtil
Returns:
length of the AVP data field

getValue

public java.lang.Object getValue()
Description copied from class: AvpValueUtil
Returns the AVP data.

Overrides:
getValue in class AvpValueUtil
Returns:
The AVP data. This must be cast to the appropriate data type.

getAvpValue

public byte[] getAvpValue()
Returns the byte array of data held by this AvpValueUtil.

Returns:
byte array of data.

setAvpValue

public void setAvpValue(byte[] value)
Sets the byte array of data held by this AvpValueUtil.

Parameters:
value - A byte array of data.


Copyright © 2006 IBM Corp. All Rights Reserved.