net.jradius.packet
Class Format

java.lang.Object
  extended by net.jradius.packet.Format
Direct Known Subclasses:
DHCPFormat, DiameterFormat, RadiusFormat

public abstract class Format
extends java.lang.Object

Author:
David Bird

Nested Class Summary
protected  class Format.AttributeParseContext
           
 
Constructor Summary
Format()
           
 
Method Summary
abstract  void packAttribute(java.io.OutputStream out, RadiusAttribute a)
           
 byte[] packAttributeList(AttributeList attrs)
          Packs an AttributeList into a byte array
static int readUnsignedByte(java.io.InputStream in)
           
static long readUnsignedInt(java.io.InputStream in)
           
static int readUnsignedShort(java.io.InputStream in)
           
abstract  int unpackAttributeHeader(java.io.InputStream in, Format.AttributeParseContext ctx)
           
 void unpackAttributes(AttributeList attrs, byte[] bytes, int bOffset, int bLength)
          Unpacks RadiusAttributes from a byte array into an AttributeList
static void writeUnsignedByte(java.io.OutputStream out, int b)
           
static void writeUnsignedInt(java.io.OutputStream out, long i)
           
static void writeUnsignedShort(java.io.OutputStream out, int s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Format

public Format()
Method Detail

packAttribute

public abstract void packAttribute(java.io.OutputStream out,
                                   RadiusAttribute a)
                            throws java.io.IOException
Throws:
java.io.IOException

unpackAttributeHeader

public abstract int unpackAttributeHeader(java.io.InputStream in,
                                          Format.AttributeParseContext ctx)
                                   throws java.io.IOException
Throws:
java.io.IOException

packAttributeList

public byte[] packAttributeList(AttributeList attrs)
Packs an AttributeList into a byte array

Parameters:
attrs - The AttributeList to pack
Returns:
Returns the packed AttributeList

unpackAttributes

public void unpackAttributes(AttributeList attrs,
                             byte[] bytes,
                             int bOffset,
                             int bLength)
Unpacks RadiusAttributes from a byte array into an AttributeList

Parameters:
attrs - The AttributeList to put unpacked attributes
bytes - The bytes to be unpacked
bLength - The length of the bytes to be unpacked

readUnsignedInt

public static long readUnsignedInt(java.io.InputStream in)
                            throws java.io.IOException
Throws:
java.io.IOException

readUnsignedShort

public static int readUnsignedShort(java.io.InputStream in)
                             throws java.io.IOException
Throws:
java.io.IOException

readUnsignedByte

public static int readUnsignedByte(java.io.InputStream in)
                            throws java.io.IOException
Throws:
java.io.IOException

writeUnsignedByte

public static void writeUnsignedByte(java.io.OutputStream out,
                                     int b)
                              throws java.io.IOException
Throws:
java.io.IOException

writeUnsignedShort

public static void writeUnsignedShort(java.io.OutputStream out,
                                      int s)
                               throws java.io.IOException
Throws:
java.io.IOException

writeUnsignedInt

public static void writeUnsignedInt(java.io.OutputStream out,
                                    long i)
                             throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2008 JRadius Project, All Rights Reserved.