com.jkristian.lang
Class ByteSequenceHelper

java.lang.Object
  extended by com.jkristian.lang.ByteSequenceHelper

public class ByteSequenceHelper
extends java.lang.Object

Utility methods for implementing a ByteSequence.

Author:
John Kristian

Constructor Summary
ByteSequenceHelper()
           
 
Method Summary
static void boundsCheck(ByteSequence that, int start, int end)
           
static void copy(ByteSequence that, int start, int end, byte[] into)
           
static boolean equals(ByteSequence x, java.lang.Object obj)
           
static int hashCode(byte datum)
           
static int hashCode(byte[] data, int first, int end)
           
static int hashCode(ByteSequence x)
           
static ByteSequence subSequence(ByteSequence that, int start, int end)
           
static byte[] toByteArray(ByteSequence that)
           
static byte[] toByteArray(ByteSequence that, int start, int end)
           
static java.lang.String toString(ByteSequence that, java.lang.String encoding)
           
static void writeTo(ByteSequence that, java.io.OutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteSequenceHelper

public ByteSequenceHelper()
Method Detail

boundsCheck

public static void boundsCheck(ByteSequence that,
                               int start,
                               int end)
                        throws java.lang.IndexOutOfBoundsException
Throws:
java.lang.IndexOutOfBoundsException

subSequence

public static ByteSequence subSequence(ByteSequence that,
                                       int start,
                                       int end)

copy

public static void copy(ByteSequence that,
                        int start,
                        int end,
                        byte[] into)

toByteArray

public static byte[] toByteArray(ByteSequence that)

toByteArray

public static byte[] toByteArray(ByteSequence that,
                                 int start,
                                 int end)

toString

public static java.lang.String toString(ByteSequence that,
                                        java.lang.String encoding)
                                 throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException

writeTo

public static void writeTo(ByteSequence that,
                           java.io.OutputStream out)
                    throws java.io.IOException
Throws:
java.io.IOException

equals

public static boolean equals(ByteSequence x,
                             java.lang.Object obj)

hashCode

public static int hashCode(ByteSequence x)

hashCode

public static int hashCode(byte datum)

hashCode

public static int hashCode(byte[] data,
                           int first,
                           int end)