FreeHEP API
Version v1.2

org.freehep.util.io
Class ByteOrderOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--java.io.FilterOutputStream
              |
              +--org.freehep.util.io.CompressableOutputStream
                    |
                    +--org.freehep.util.io.BitOutputStream
                          |
                          +--org.freehep.util.io.ByteOrderOutputStream
All Implemented Interfaces:
DataOutput, FinishableOutputStream, ImageOutput
Direct Known Subclasses:
ByteCountOutputStream

public class ByteOrderOutputStream
extends BitOutputStream
implements DataOutput, ImageOutput

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

Version:
$Id: ByteOrderOutputStream.java,v 1.6 2003/05/07 14:30:02 duns Exp $
Author:
Mark Donszelmann, Charles Loomis

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)
           
 int writeImage(Image image, Color bkg, String code, int pad, ImageObserver observer)
           
 int writeImage(RenderedImage image, Color bkg, String code, int pad)
           
 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
IOException

write

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

writeBoolean

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

writeChar

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

writeByte

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

Specified by:
writeByte in interface DataOutput
IOException

writeByte

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

writeUnsignedByte

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

IOException

writeUnsignedByte

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

writeShort

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

Specified by:
writeShort in interface DataOutput
IOException

writeShort

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

writeUnsignedShort

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

IOException

writeUnsignedShort

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

writeInt

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

Specified by:
writeInt in interface DataOutput
IOException

writeInt

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

writeUnsignedInt

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

IOException

writeUnsignedInt

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

writeLong

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

writeFloat

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

writeDouble

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

writeBytes

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

writeChars

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

writeString

public void writeString(String s)
                 throws IOException
IOException

writeUTF

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

writeAsciiZString

public void writeAsciiZString(String s)
                       throws IOException
IOException

writeUTF

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

writeImage

public int writeImage(Image image,
                      Color bkg,
                      String code,
                      int pad,
                      ImageObserver observer)
               throws IOException
Specified by:
writeImage in interface ImageOutput
IOException

writeImage

public int writeImage(RenderedImage image,
                      Color bkg,
                      String code,
                      int pad)
               throws IOException
Specified by:
writeImage in interface ImageOutput
IOException

FreeHEP API
Version v1.2

Copyright © 2000-2003 FreeHEP, All Rights Reserved.