FreeHEP API
Version current

org.freehep.util.io
Class ByteOrderOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byjava.io.FilterOutputStream
          extended byorg.freehep.util.io.CompressableOutputStream
              extended byorg.freehep.util.io.BitOutputStream
                  extended byorg.freehep.util.io.ByteOrderOutputStream
All Implemented Interfaces:
DataOutput, FinishableOutputStream
Direct Known Subclasses:
ByteCountOutputStream

public class ByteOrderOutputStream
extends BitOutputStream
implements DataOutput

Class to write bytes and pairs of bytes in both little and big endian order.

Version:
$Id: ByteOrderOutputStream.java,v 1.8 2005/01/10 18:29:57 duns Exp $
Author:
Mark Donszelmann, Charles Loomis
Source Code:
ByteOrderOutputStream.java

Field Summary
protected  boolean little
           
protected  int written
           
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
ByteOrderOutputStream(OutputStream out)
           
ByteOrderOutputStream(OutputStream out, boolean littleEndian)
           
 
Method Summary
 int size()
           
 void write(int b)
           
 void writeAsciiZString(String s)
           
 void writeBoolean(boolean b)
           
 void writeByte(byte[] bytes)
           
 void writeByte(int b)
          Write a signed byte.
 void writeBytes(String s)
           
 void writeChar(int c)
           
 void writeChars(String s)
           
 void writeDouble(double d)
           
 void writeFloat(float f)
           
 void writeInt(int i)
          Write a signed integer.
 void writeInt(int[] ints)
           
 void writeLong(long l)
           
 void writeShort(int s)
          Write a signed short.
 void writeShort(short[] shorts)
           
 void writeString(String s)
           
 void writeUnsignedByte(int ub)
          Write an unsigned byte.
 void writeUnsignedByte(int[] bytes)
           
 void writeUnsignedInt(long i)
          Write an unsigned integer.
 void writeUnsignedInt(long[] ints)
           
 void writeUnsignedShort(int s)
          Write an unsigned short.
 void writeUnsignedShort(int[] shorts)
           
 void writeUTF(String s)
           
static void writeUTF(String s, DataOutput dos)
           
 
Methods inherited from class org.freehep.util.io.BitOutputStream
byteAlign, close, finish, flushByte, minBits, minBits, minBits, writeBitFlag, writeFBits, writeSBits, writeUBits
 
Methods inherited from class org.freehep.util.io.CompressableOutputStream
startCompressing, write
 
Methods inherited from class java.io.FilterOutputStream
flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.DataOutput
write, write
 

Field Detail

little

protected boolean little

written

protected int written
Constructor Detail

ByteOrderOutputStream

public ByteOrderOutputStream(OutputStream out)

ByteOrderOutputStream

public ByteOrderOutputStream(OutputStream out,
                             boolean littleEndian)
Method Detail

size

public int size()
         throws IOException
Throws:
IOException

write

public void write(int b)
           throws IOException
Specified by:
write in interface DataOutput
Overrides:
write in class BitOutputStream
Throws:
IOException

writeBoolean

public void writeBoolean(boolean b)
                  throws IOException
Specified by:
writeBoolean in interface DataOutput
Throws:
IOException

writeChar

public void writeChar(int c)
               throws IOException
Specified by:
writeChar in interface DataOutput
Throws:
IOException

writeByte

public void writeByte(int b)
               throws IOException
Write a signed byte.

Specified by:
writeByte in interface DataOutput
Throws:
IOException

writeByte

public void writeByte(byte[] bytes)
               throws IOException
Throws:
IOException

writeUnsignedByte

public void writeUnsignedByte(int ub)
                       throws IOException
Write an unsigned byte.

Throws:
IOException

writeUnsignedByte

public void writeUnsignedByte(int[] bytes)
                       throws IOException
Throws:
IOException

writeShort

public void writeShort(int s)
                throws IOException
Write a signed short.

Specified by:
writeShort in interface DataOutput
Throws:
IOException

writeShort

public void writeShort(short[] shorts)
                throws IOException
Throws:
IOException

writeUnsignedShort

public void writeUnsignedShort(int s)
                        throws IOException
Write an unsigned short.

Throws:
IOException

writeUnsignedShort

public void writeUnsignedShort(int[] shorts)
                        throws IOException
Throws:
IOException

writeInt

public void writeInt(int i)
              throws IOException
Write a signed integer.

Specified by:
writeInt in interface DataOutput
Throws:
IOException

writeInt

public void writeInt(int[] ints)
              throws IOException
Throws:
IOException

writeUnsignedInt

public void writeUnsignedInt(long i)
                      throws IOException
Write an unsigned integer.

Throws:
IOException

writeUnsignedInt

public void writeUnsignedInt(long[] ints)
                      throws IOException
Throws:
IOException

writeLong

public void writeLong(long l)
               throws IOException
Specified by:
writeLong in interface DataOutput
Throws:
IOException

writeFloat

public void writeFloat(float f)
                throws IOException
Specified by:
writeFloat in interface DataOutput
Throws:
IOException

writeDouble

public void writeDouble(double d)
                 throws IOException
Specified by:
writeDouble in interface DataOutput
Throws:
IOException

writeBytes

public void writeBytes(String s)
                throws IOException
Specified by:
writeBytes in interface DataOutput
Throws:
IOException

writeChars

public void writeChars(String s)
                throws IOException
Specified by:
writeChars in interface DataOutput
Throws:
IOException

writeString

public void writeString(String s)
                 throws IOException
Throws:
IOException

writeUTF

public void writeUTF(String s)
              throws IOException
Specified by:
writeUTF in interface DataOutput
Throws:
IOException

writeAsciiZString

public void writeAsciiZString(String s)
                       throws IOException
Throws:
IOException

writeUTF

public static void writeUTF(String s,
                            DataOutput dos)
                     throws IOException
Throws:
IOException

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.