Package uk.ac.starlink.fits

# Class CardImage

java.lang.Object
uk.ac.starlink.fits.CardImage

public class CardImage extends Object
Represents a FITS header card that will be written. It is a thin wrapper around an 80-byte buffer providing the ASCII content.

Since:
  4 Mar 2022
Author:
  Mark Taylor
See Also:
  - `FitsUtil.writeHeader(uk.ac.starlink.fits.CardImage[], java.io.OutputStream)`

## Constructor Summary

Constructors
Constructor
Description
`CardImage(byte[] buf80)`
Constructs a CardImage from an 80-element byte array.
`CardImage(CharSequence txt80)`
Constructs a CardImage from an 80-character CharSequence.

## Method Summary

Modifier and Type
Method
Description
`byte[]`
`getBytes()`
Returns this image as a byte array.
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### CardImage

public CardImage(byte[] buf80)
Constructs a CardImage from an 80-element byte array.

Parameters:
  `buf80` - 80-byte array containing ASCII characters
Throws:
  `IllegalArgumentException` - if the array is the wrong length or contains illegal characters

### CardImage

public CardImage(CharSequence txt80)
Constructs a CardImage from an 80-character CharSequence.

Parameters:
  `txt80` - 80-character sequence containing ASCII characters
Throws:
  `IllegalArgumentException` - if the string is the wrong length or contains illegal characters

## Method Details

### getBytes

public byte[] getBytes()
Returns this image as a byte array.

Returns:
  80-element byte array

### toString

public String toString()

Overrides:
  `toString` in class `Object`
Returns:
  80-character string