# Class SerializerDeserializer

java.lang.Object
org.apache.datasketches.tuple.SerializerDeserializer

public final class SerializerDeserializer extends Object
Multipurpose serializer-deserializer for a collection of sketches defined by the enum.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`SerializerDeserializer.SketchType`
Defines the sketch classes that this SerializerDeserializer can handle.

## Constructor Summary

Constructors
Constructor
Description
`SerializerDeserializer()`
No argument constructor.

## Method Summary

Modifier and Type
Method
Description
`static SerializerDeserializer.SketchType`
`getSketchType(MemorySegment seg)`
Gets the sketch type byte from the given MemorySegment image
`static void`
`validateFamily(byte familyId, byte preambleLongs)`
Validates the preamble-Longs value given the family ID
`static void`
`validateType(byte sketchTypeByte, SerializerDeserializer.SketchType expectedType)`
Validates the sketch type byte versus the expected value

### Methods inherited from class Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### SerializerDeserializer

public SerializerDeserializer()
No argument constructor.

## Method Details

### validateFamily

public static void validateFamily(byte familyId, byte preambleLongs)
Validates the preamble-Longs value given the family ID

Parameters:
  `familyId` - the given family ID
  `preambleLongs` - the given preambleLongs value

### validateType

public static void validateType(byte sketchTypeByte, SerializerDeserializer.SketchType expectedType)
Validates the sketch type byte versus the expected value

Parameters:
  `sketchTypeByte` - the given sketch type byte
  `expectedType` - the expected value

### getSketchType

public static SerializerDeserializer.SketchType getSketchType(MemorySegment seg)
Gets the sketch type byte from the given MemorySegment image

Parameters:
  `seg` - the given MemorySegment image
Returns:
  the SketchType