# Class MocStreamFormat

java.lang.Object
uk.ac.starlink.ttools.moc.MocStreamFormat

public abstract class MocStreamFormat extends Object
Defines a MOC serialization format.

Since:
  8 Dec 2016
Author:
  Mark Taylor

## Field Summary

Fields
Modifier and Type
Field
Description
`static final MocStreamFormat`
`ASCII`
Writes MOC 2.0 ASCII output.
`static final MocStreamFormat`
`CDS_ASCII`
Writes MOC 2.0 ASCII format using CDS SMoc serialization.
`static final MocStreamFormat`
`CDS_FITS`
Writes MOC 1.0-compliant FITS files using CDS SMoc serialization.
`static final MocStreamFormat`
`CDS_JSON`
Writes JSON format using CDS SMoc serialization.
`static final MocStreamFormat`
`FITS`
Writes MOC 1.0-compliant FITS files.
`static final MocStreamFormat[]`
`FORMATS`
Known format instances.
`static final MocStreamFormat`
`JSON`
Writes JSON format.
`static final MocStreamFormat`
`RAW`
Writes a list of UNIQ values.
`static final MocStreamFormat`
`SUMMARY`
Writes a text summary.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`MocStreamFormat(String name)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`String`
`toString()`
`abstract void`
`writeMoc(PrimitiveIterator.OfLong uniqIt, long count, int maxOrder, OutputStream out)`
Outputs a given MOC to a given stream.

### Methods inherited from class Object

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

## Field Details

### ASCII

public static final MocStreamFormat ASCII
Writes MOC 2.0 ASCII output.

### JSON

public static final MocStreamFormat JSON
Writes JSON format.

### FITS

public static final MocStreamFormat FITS
Writes MOC 1.0-compliant FITS files.

### RAW

public static final MocStreamFormat RAW
Writes a list of UNIQ values.

### SUMMARY

public static final MocStreamFormat SUMMARY
Writes a text summary.

### CDS_ASCII

public static final MocStreamFormat CDS_ASCII
Writes MOC 2.0 ASCII format using CDS SMoc serialization.

### CDS_JSON

public static final MocStreamFormat CDS_JSON
Writes JSON format using CDS SMoc serialization.

### CDS_FITS

public static final MocStreamFormat CDS_FITS
Writes MOC 1.0-compliant FITS files using CDS SMoc serialization.

### FORMATS

public static final MocStreamFormat[] FORMATS
Known format instances.

## Constructor Details

### MocStreamFormat

protected MocStreamFormat(String name)
Constructor.

Parameters:
  `name` - format name

## Method Details

### writeMoc

public abstract void writeMoc(PrimitiveIterator.OfLong uniqIt, long count, int maxOrder, OutputStream out) throws IOException
Outputs a given MOC to a given stream.

Parameters:
  `uniqIt` - iterator over sorted list of uniq-encoded tile values
  `count` - number of tiles in iterator
  `maxOrder` - maximum HEALPix order represented in iterator
  `out` - destination stream
Throws:
  `IOException`

### toString

public String toString()

Overrides:
  `toString` in class `Object`