edu.washington.biostr.sig.volume
Class ByteEncoder

java.lang.Object
  extended by edu.washington.biostr.sig.volume.ByteEncoder

public class ByteEncoder
extends Object

Handle writing numbers in the specified endianness.

Version:
1.0
Author:
Eider Moore

Constructor Summary
ByteEncoder(OutputStream out, ByteOrder endian)
           
 
Method Summary
 void close()
           
protected  void finalize()
           
 ByteOrder getEndian()
           
 OutputStream getOut()
           
 void write(byte value)
           
 void write(char value)
          Convenience method for encoding a char into a byte stream.
 void write(double value)
          Convenience method for encoding a double into a byte stream.
 void write(float value)
          Convenience method for encoding a float into a byte stream.
 void write(int value)
          Convenience method for encoding an int into a byte stream.
 void write(long value)
          Convenience method for encoding a long into a byte stream.
 void write(short value)
          Convenience method for encoding a short into a byte stream.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteEncoder

public ByteEncoder(OutputStream out,
                   ByteOrder endian)
Parameters:
out - The stream to which to send written numbers
endian - The endianness (Big or Little)
Method Detail

getOut

public OutputStream getOut()
Returns:
The output target

getEndian

public ByteOrder getEndian()
Returns:
The endianess

write

public void write(long value)
           throws IOException
Convenience method for encoding a long into a byte stream.

Parameters:
value -
out -
Throws:
IOException

write

public void write(int value)
           throws IOException
Convenience method for encoding an int into a byte stream.

Parameters:
value -
out -
Throws:
IOException

write

public void write(byte value)
           throws IOException
Throws:
IOException

write

public void write(short value)
           throws IOException
Convenience method for encoding a short into a byte stream.

Parameters:
value -
out -
Throws:
IOException

write

public void write(char value)
           throws IOException
Convenience method for encoding a char into a byte stream.

Parameters:
value -
out -
Throws:
IOException

write

public void write(float value)
           throws IOException
Convenience method for encoding a float into a byte stream.

Parameters:
value -
out -
Throws:
IOException

write

public void write(double value)
           throws IOException
Convenience method for encoding a double into a byte stream.

Parameters:
value -
out -
Throws:
IOException

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

close

public void close()
           throws IOException
Throws:
IOException


Copyright © 2006 University of Washington. All Rights Reserved.