Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## baseCode.io
Class ByteArrayConverter

    java.lang.Object
      baseCode.io.ByteArrayConverter

public class ByteArrayConverter
extends java.lang.Object

Class to convert byte arrays (e.g., Blobs) to and from other types of arrays.

TODO this could be optimized, and errors are not handled well.

Version:
  $Id: ByteArrayConverter.java,v 1.8 2005/04/09 09:03:22 pavlidis Exp $
Author:
  Kiran Keshav, Paul Pavlidis

Constructor Summary
`ByteArrayConverter()`

Method Summary
`java.lang.String` | `byteArrayToAsciiString(byte[] barray)` Convert a byte array with one-byte-per-character ASCII encoding (aka ISO-8859-1).
`char[]` | `byteArrayToChars(byte[] barray)`
`double[]` | `byteArrayToDoubles(byte[] barray)`
`int[]` | `byteArrayToInts(byte[] barray)`
`long[]` | `byteArrayToLongs(byte[] barray)`
`byte[]` | `charArrayToBytes(char[] carray)`
`byte[]` | `doubleArrayToBytes(double[] darray)`
`byte[]` | `intArrayToBytes(int[] iarray)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ByteArrayConverter

    public ByteArrayConverter()

Method Detail

### byteArrayToAsciiString

    public java.lang.String byteArrayToAsciiString(byte[] barray)

  Convert a byte array with one-byte-per-character ASCII encoding (aka ISO-8859-1).

  Parameters:
    `barray` -
  Returns:

### byteArrayToChars

    public char[] byteArrayToChars(byte[] barray)

  Parameters:
    `barray` -
  Returns:
    char[]

### byteArrayToDoubles

    public double[] byteArrayToDoubles(byte[] barray)

  Parameters:
    `barray` -
  Returns:
    double[]

### byteArrayToInts

    public int[] byteArrayToInts(byte[] barray)

  Parameters:
    `barray` -
  Returns:
    int[]

### byteArrayToLongs

    public long[] byteArrayToLongs(byte[] barray)

  Parameters:
    `barray` -
  Returns:
    long[] resulting from parse of the bytes.

### charArrayToBytes

    public byte[] charArrayToBytes(char[] carray)

  Parameters:
    `carray` -
  Returns:
    byte[]

### doubleArrayToBytes

    public byte[] doubleArrayToBytes(double[] darray)

  Parameters:
    `darray` -
  Returns:
    byte[]

### intArrayToBytes

    public byte[] intArrayToBytes(int[] iarray)

  Parameters:
    `iarray` -
  Returns:
    byte[]

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2005 Columbia University. All Rights Reserved.