int putData(Object data) throws FitsException {
  long lsize=ArrayFuncs.computeLSize(data);
  if (lsize > Integer.MAX_VALUE) {
    throw new FitsException("FITS Heap > 2 G");
  }
  int size=(int)lsize;
  expandHeap(size);
  ByteArrayOutputStream bo=new ByteArrayOutputStream(size);
  try {
    BufferedDataOutputStream o=new BufferedDataOutputStream(bo);
    o.writeArray(data);
    o.flush();
    o.close();
  }
 catch (  IOException e) {
    throw new FitsException("Unable to write variable column length data",e);
  }
  System.arraycopy(bo.toByteArray(),0,this.heap,this.heapSize,size);
  int oldOffset=this.heapSize;
  this.heapSize+=size;
  return oldOffset;
}

int putData ( Object data ) throws FitsException { long lsize = ArrayFuncs . computeLSize ( data ) ; if ( lsize > Integer . MAX_VALUE ) { throw new FitsException ( "FITS Heap > 2 G" ) ; } int size = ( int ) lsize ; expandHeap ( size ) ; ByteArrayOutputStream bo = new ByteArrayOutputStream ( size ) ; try { BufferedDataOutputStream o = new BufferedDataOutputStream ( bo ) ; o . writeArray ( data ) ; o . flush ( ) ; o . close ( ) ; } catch ( IOException e ) { throw new FitsException ( "Unable to write variable column length data" , e ) ; } System . arraycopy ( bo . toByteArray ( ) , 0 , this . heap , this . heapSize , size ) ; int oldOffset = this . heapSize ; this . heapSize += size ; return oldOffset ; }
add some data to the heap .
