compress
Class BitsToFile

java.lang.Object
  |
  +--compress.BitsToFile

class BitsToFile
extends java.lang.Object

Behavior class. Writes vectors of bits to a file.

Author:
Chad Cook

Field Summary
(package private)  java.io.FileOutputStream _fstreamOut
           
(package private)  int _offset
           
(package private)  int _offsetIncrementor
           
(package private)  int[] _singleByte
           
 
Constructor Summary
(package private) BitsToFile(java.io.FileOutputStream fstreamOut)
          Constructor.
 
Method Summary
(package private)  void execute(java.util.Vector oneCode)
          Writes a vector of bits to the file.
(package private)  int finishUp()
          When we get to the end of a file, we need to write the last vector, even though it may not be full.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

_fstreamOut

java.io.FileOutputStream _fstreamOut

_offset

int _offset

_offsetIncrementor

int _offsetIncrementor

_singleByte

int[] _singleByte
Constructor Detail

BitsToFile

BitsToFile(java.io.FileOutputStream fstreamOut)
Constructor.
Parameters:
FileOutputStream - The stream to the file you want to write to.
Method Detail

finishUp

int finishUp()
When we get to the end of a file, we need to write the last vector, even though it may not be full. So I use this method to write zeros after the data that has been put in so far. Then I can call execute and everything will be okay. I just call it on a new vector with a zero in it. This is so the execute method will actually go through the for loop once.

execute

void execute(java.util.Vector oneCode)
Writes a vector of bits to the file.
Parameters:
Vector - The vector of bits to write to the file.