Class CRAMEncoding<T>

    • Constructor Detail

      • CRAMEncoding

        protected CRAMEncoding​(EncodingID id)
        Create a new encoding. Concrete implementation constructors will specify their parameters
        Parameters:
        id - the EncodingID associated with the concrete implementation
    • Method Detail

      • toByteArray

        public abstract byte[] toByteArray()
        Subclasses but have a defined serialization of their parameters
        Returns:
        a byte array representing a specific encoding's parameter values
      • buildCodec

        public abstract CRAMCodec<T> buildCodec​(BitInputStream coreBlockInputStream,
                                                BitOutputStream coreBlockOutputStream,
                                                Map<Integer,​ByteArrayInputStream> externalBlockInputMap,
                                                Map<Integer,​ByteArrayOutputStream> externalBlockOutputMap)
        Instantiate the codec represented by this encoding by supplying it with the appropriate streams
        Parameters:
        coreBlockInputStream - the core block bit stream a CoreCodec will read from
        coreBlockOutputStream - the core block bit stream a CoreCodec will write to
        externalBlockInputMap - the external block byte stream a ExternalCodec will read from
        externalBlockOutputMap - the external block byte stream a ExternalCodec will write to
        Returns:
        a newly instantiated codec
      • buildReadCodec

        public CRAMCodec<T> buildReadCodec​(BitInputStream coreBlockInputStream,
                                           Map<Integer,​ByteArrayInputStream> externalBlockInputMap)
        Convenience initializer method for read codecs
        Parameters:
        coreBlockInputStream - the core block bit stream a CoreCodec will read from
        externalBlockInputMap - the external block byte stream a ExternalCodec will read from
        Returns:
      • buildWriteCodec

        public CRAMCodec<T> buildWriteCodec​(BitOutputStream coreBlockOutputStream,
                                            Map<Integer,​ByteArrayOutputStream> externalBlockOutputMap)
        Convenience initializer method for write codecs
        Parameters:
        coreBlockOutputStream - the core block bit stream a CoreCodec will write to
        externalBlockOutputMap - the external block byte stream a ExternalCodec will write to
        Returns: