org.infinispan.io
Class UnsignedNumeric

java.lang.Object
  extended by org.infinispan.io.UnsignedNumeric

public class UnsignedNumeric
extends Object

Helper to read and write unsigned numerics

Since:
4.0
Author:
Manik Surtani

Constructor Summary
UnsignedNumeric()
           
 
Method Summary
static int readUnsignedInt(byte[] bytes, int offset)
          Reads an int stored in variable-length format.
static int readUnsignedInt(ObjectInput in)
          Reads an int stored in variable-length format.
static long readUnsignedLong(byte[] bytes, int offset)
          Reads an int stored in variable-length format.
static long readUnsignedLong(ObjectInput in)
          Reads an int stored in variable-length format.
static void writeUnsignedInt(byte[] bytes, int offset, int i)
          Writes an int in a variable-length format.
static void writeUnsignedInt(ObjectOutput out, int i)
          Writes an int in a variable-length format.
static void writeUnsignedLong(byte[] bytes, int offset, long i)
          Writes an int in a variable-length format.
static void writeUnsignedLong(ObjectOutput out, long i)
          Writes an int in a variable-length format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnsignedNumeric

public UnsignedNumeric()
Method Detail

readUnsignedInt

public static int readUnsignedInt(ObjectInput in)
                           throws IOException
Reads an int stored in variable-length format. Reads between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.

Throws:
IOException

writeUnsignedInt

public static void writeUnsignedInt(ObjectOutput out,
                                    int i)
                             throws IOException
Writes an int in a variable-length format. Writes between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.

Parameters:
i - int to write
Throws:
IOException

readUnsignedLong

public static long readUnsignedLong(ObjectInput in)
                             throws IOException
Reads an int stored in variable-length format. Reads between one and nine bytes. Smaller values take fewer bytes. Negative numbers are not supported.

Throws:
IOException

writeUnsignedLong

public static void writeUnsignedLong(ObjectOutput out,
                                     long i)
                              throws IOException
Writes an int in a variable-length format. Writes between one and nine bytes. Smaller values take fewer bytes. Negative numbers are not supported.

Parameters:
i - int to write
Throws:
IOException

readUnsignedInt

public static int readUnsignedInt(byte[] bytes,
                                  int offset)
                           throws IOException
Reads an int stored in variable-length format. Reads between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.

Throws:
IOException

writeUnsignedInt

public static void writeUnsignedInt(byte[] bytes,
                                    int offset,
                                    int i)
                             throws IOException
Writes an int in a variable-length format. Writes between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.

Parameters:
i - int to write
Throws:
IOException

readUnsignedLong

public static long readUnsignedLong(byte[] bytes,
                                    int offset)
                             throws IOException
Reads an int stored in variable-length format. Reads between one and nine bytes. Smaller values take fewer bytes. Negative numbers are not supported.

Throws:
IOException

writeUnsignedLong

public static void writeUnsignedLong(byte[] bytes,
                                     int offset,
                                     long i)
                              throws IOException
Writes an int in a variable-length format. Writes between one and nine bytes. Smaller values take fewer bytes. Negative numbers are not supported.

Parameters:
i - int to write
Throws:
IOException

Google Analytics

Copyright © 2010 JBoss, a division of Red Hat. All Rights Reserved.