org.mailster.util
Class ByteUtilities

java.lang.Object
  extended by org.mailster.util.ByteUtilities

public class ByteUtilities
extends java.lang.Object

---
Mailster (C) 2007-2009 De Oliveira Edouard

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

See  Mailster Web Site
---

MailUtilities.java - Various methods to help manipulate bytes.

Version:
$Revision: 1.4 $, $Date: 2008/12/06 13:57:17 $
Author:
Edouard De Oliveira

Constructor Summary
ByteUtilities()
           
 
Method Summary
static void intToNetworkByteOrder(int num, byte[] buf, int start, int count)
          Encodes an integer into 4 bytes in network byte order in the buffer supplied.
static int networkByteOrderToInt(byte[] buf, int start, int count)
          Returns the integer represented by 4 bytes in network byte order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteUtilities

public ByteUtilities()
Method Detail

networkByteOrderToInt

public static int networkByteOrderToInt(byte[] buf,
                                        int start,
                                        int count)
Returns the integer represented by 4 bytes in network byte order.


intToNetworkByteOrder

public static void intToNetworkByteOrder(int num,
                                         byte[] buf,
                                         int start,
                                         int count)
Encodes an integer into 4 bytes in network byte order in the buffer supplied.