public static void pad(ArrayDataOutput stream,long size,byte fill) throws FitsException {
  int len=padding(size);
  if (len > 0) {
    byte[] buf=new byte[len];
    Arrays.fill(buf,fill);
    try {
      stream.write(buf);
      stream.flush();
    }
 catch (    Exception e) {
      throw new FitsException("Unable to write padding",e);
    }
  }
}

public static void pad ( ArrayDataOutput stream , long size , byte fill ) throws FitsException { int len = padding ( size ) ; if ( len > 0 ) { byte [ ] buf = new byte [ len ] ; Arrays . fill ( buf , fill ) ; try { stream . write ( buf ) ; stream . flush ( ) ; } catch ( Exception e ) { throw new FitsException ( "Unable to write padding" , e ) ; } } }
add padding to an output stream .
