Class AbstractMagicBytesTransmissionDecorator<DECORATEE extends Transmission>

java.lang.Object
org.refcodes.serial.AbstractMagicBytesTransmission
org.refcodes.serial.AbstractMagicBytesTransmissionDecorator<DECORATEE>
Type Parameters:
DECORATEE - The decoratee type describing the decoratee subclass decoratee.
All Implemented Interfaces:
Serializable, org.refcodes.mixin.AliasAccessor, org.refcodes.mixin.DecorateeAccessor<DECORATEE>, org.refcodes.mixin.EncodingAccessor<Charset>, org.refcodes.mixin.LengthAccessor, org.refcodes.mixin.MagicBytesAccessor, org.refcodes.mixin.MagicBytesAccessor.MagicBytesMutator, org.refcodes.mixin.MagicBytesAccessor.MagicBytesProperty, org.refcodes.mixin.PayloadAccessor<byte[]>, org.refcodes.mixin.PayloadAccessor.PayloadBuilder<byte[],PayloadTransmission<byte[]>>, org.refcodes.mixin.PayloadAccessor.PayloadMutator<byte[]>, org.refcodes.mixin.PayloadAccessor.PayloadProperty<byte[]>, org.refcodes.mixin.Schemable<SerialSchema>, MagicBytesAccessor, MagicBytesAccessor.MagicBytesMutator, MagicBytesAccessor.MagicBytesProperty, MagicBytesLengthAccessor, PayloadTransmission<byte[]>, Transmission, Transmission.TransmissionMixin
Direct Known Subclasses:
MagicBytesSectionDecorator, MagicBytesSegmentDecorator

public abstract class AbstractMagicBytesTransmissionDecorator<DECORATEE extends Transmission> extends AbstractMagicBytesTransmission implements Transmission, org.refcodes.mixin.DecorateeAccessor<DECORATEE>
Magic bytes are usually found (somewhere) at the beginning of a file or a stream. A AbstractMagicBytesTransmissionDecorator decorates a decoratee decoratee and prefixes this decoratee instance with given magic bytes.
See Also:
  • Field Details

  • Constructor Details

    • AbstractMagicBytesTransmissionDecorator

      public AbstractMagicBytesTransmissionDecorator(String aAlias, DECORATEE aDecoratee, TransmissionMetrics aTransmissionMetrics)
      Enriches the provided decoratee with magic bytes of the given length to be prefixed. The configuration attributes are taken from the TransmissionMetrics configuration object, though only those attributes are supported which are also supported by the other constructors!
      Parameters:
      aAlias - The alias which identifies the content of this segment.
      aDecoratee - The decoratee which to be prefixed with magic bytes.
      aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
    • AbstractMagicBytesTransmissionDecorator

      public AbstractMagicBytesTransmissionDecorator(String aAlias, DECORATEE aDecoratee, int aMagicBytesLength)
      Enriches the provided decoratee with magic bytes of the given length to be prefixed.
      Parameters:
      aAlias - The alias which identifies the content of this segment.
      aDecoratee - The decoratee which to be prefixed with magic bytes.
      aMagicBytesLength - The length of the magic bytes sequence.
    • AbstractMagicBytesTransmissionDecorator

      public AbstractMagicBytesTransmissionDecorator(String aAlias, DECORATEE aDecoratee, String aMagicBytes)
      Enriches the provided decoratee with magic bytes being prefixed (retrieved from the given String).
      Parameters:
      aAlias - The alias which identifies the content of this segment.
      aDecoratee - The decoratee which to be prefixed with magic bytes.
      aMagicBytes - The String to be stored by this instance as magic bytes (uses the TransmissionMetrics.DEFAULT_ENCODING) for byte conversion).
    • AbstractMagicBytesTransmissionDecorator

      public AbstractMagicBytesTransmissionDecorator(String aAlias, DECORATEE aDecoratee, String aMagicBytes, Charset aCharset)
      Enriches the provided decoratee with magic bytes being prefixed (retrieved from the given String).
      Parameters:
      aAlias - The alias which identifies the content of this segment.
      aDecoratee - The decoratee which to be prefixed with magic bytes.
      aMagicBytes - The String to be stored by this instance as magic bytes.
      aCharset - The Charset to use when converting the String to a byte array.
    • AbstractMagicBytesTransmissionDecorator

      public AbstractMagicBytesTransmissionDecorator(String aAlias, DECORATEE aDecoratee, byte[] aMagicBytes)
      Enriches the provided decoratee with the given magic bytes being prefixed.
      Parameters:
      aAlias - The alias which identifies the content of this segment.
      aDecoratee - The decoratee which to be prefixed with magic bytes.
      aMagicBytes - The magic bytes to be prefixed.
  • Method Details