com.ericdaugherty.mail.server.utils
Class ByteUtils

java.lang.Object
  extended by com.ericdaugherty.mail.server.utils.ByteUtils

public class ByteUtils
extends java.lang.Object

Various SMTP/POP3 related settings.

Author:
Andreas Kyrmegalos

Constructor Summary
ByteUtils()
           
 
Method Summary
static void computeAndSetParityBit(byte[] input)
           
static byte[] convert8bitTo7bit(byte[] input, boolean resetParityBit)
           
static byte[] convert8bitTo7bit(byte[] input, int offset, boolean resetParityBit)
           
static int getIntegerFromNetworkByteOrder(byte[] buf, int offset, int length)
          Constructs an integer based on network byte order.
static void getNetworkByteOrderFromInt(int num, byte[] buf, int offset, int length)
          Encodes an integer into network byte order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteUtils

public ByteUtils()
Method Detail

computeAndSetParityBit

public static final void computeAndSetParityBit(byte[] input)

convert8bitTo7bit

public static final byte[] convert8bitTo7bit(byte[] input,
                                             int offset,
                                             boolean resetParityBit)

convert8bitTo7bit

public static final byte[] convert8bitTo7bit(byte[] input,
                                             boolean resetParityBit)

getNetworkByteOrderFromInt

public static final void getNetworkByteOrderFromInt(int num,
                                                    byte[] buf,
                                                    int offset,
                                                    int length)
Encodes an integer into network byte order.


getIntegerFromNetworkByteOrder

public static final int getIntegerFromNetworkByteOrder(byte[] buf,
                                                       int offset,
                                                       int length)
Constructs an integer based on network byte order.