Class BaseDecoder
java.lang.Object
org.refcodes.component.AbstractConnectable
org.refcodes.component.AbstractConnectableAutomaton
org.refcodes.codec.BaseDecoder
- All Implemented Interfaces:
BaseMetricsAccessor, BaseMetricsAccessor.BaseMetricsBuilder<BaseDecoder>, BaseMetricsAccessor.BaseMetricsMutator, BaseMetricsAccessor.BaseMetricsProperty, Decoder, Closable, Closable.CloseAutomaton, ClosedAccessor, ConnectableComponent, ConnectableComponent.ConnectableAutomaton, ConnectionStatusAccessor, OpenedAccessor, Availability, ByteDestination, ByteReceiver, BytesDestination, BytesReceiver, Receivable, Skippable, TimeoutInputStreamAccessor, InputStreamAccessor
- Direct Known Subclasses:
BaseDecoder.BaseDecoderConnection
public class BaseDecoder
extends AbstractConnectableAutomaton
implements BaseMetricsAccessor.BaseMetricsProperty, BaseMetricsAccessor.BaseMetricsBuilder<BaseDecoder>, Decoder
The
BaseDecoder implements the BaseBuilder functionality in
terms of a BytesReceiver. It implements the Decoder interface
attaching to the "refcodes-io" artifact via the BytesReceiver
interface. This increases the scope of usage scenarios.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTheBaseDecoder.BaseDecoderConnectionimplements theBaseDecoderfunctionality in terms of aConnectionComponent.Nested classes/interfaces inherited from interface BaseMetricsAccessor
BaseMetricsAccessor.BaseMetricsBuilder<B>, BaseMetricsAccessor.BaseMetricsMutator, BaseMetricsAccessor.BaseMetricsPropertyNested classes/interfaces inherited from interface BytesReceiver
BytesReceiver.ReceiverInputStreamNested classes/interfaces inherited from interface Closable
Closable.CloseAutomaton, Closable.CloseBuilder<B>Nested classes/interfaces inherited from interface ClosedAccessor
ClosedAccessor.ClosedMutator, ClosedAccessor.ClosedPropertyNested classes/interfaces inherited from interface ConnectableComponent
ConnectableComponent.ConnectableAutomatonNested classes/interfaces inherited from interface ConnectionStatusAccessor
ConnectionStatusAccessor.ConnectionStatusMutator, ConnectionStatusAccessor.ConnectionStatusPropertyNested classes/interfaces inherited from interface InputStreamAccessor
InputStreamAccessor.InputStreamBuilder<B>, InputStreamAccessor.InputStreamMutator, InputStreamAccessor.InputStreamPropertyNested classes/interfaces inherited from interface OpenedAccessor
OpenedAccessor.OpenedMutator, OpenedAccessor.OpenedPropertyNested classes/interfaces inherited from interface TimeoutInputStreamAccessor
TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<B>, TimeoutInputStreamAccessor.TimeoutInputStreamMutator, TimeoutInputStreamAccessor.TimeoutInputStreamProperty -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedExplicit default constructor.BaseDecoder(InputStream aInputStream) Constructs theBaseDecoderreading the data to be decoded from the providedInputStream.BaseDecoder(InputStream aInputStream, BaseMetrics aBaseMetrics) Constructs theBaseDecoderreading the data to be decoded from the providedInputStream.BaseDecoder(BytesDestination aByteProvider) Constructs theBaseDecoderreading the data to be decoded from the providedBytesDestination.BaseDecoder(BytesReceiver aByteReceiver) Constructs theBaseDecoderreading the data to be decoded from the providedBytesReceiver.BaseDecoder(InputStreamByteReceiver aInputStreamByteReceiver, BaseMetrics aBaseMetrics) Constructs theBaseDecoderreading the data to be decoded from the providedInputStreamByteReceiver. -
Method Summary
Modifier and TypeMethodDescriptionintvoidclose()Retrieves the base codec metrics from the base codec metrics property.protected voidopen(BytesDestination aConnection) Open.byte[]bytevoidsetBaseMetrics(BaseMetrics aBaseMetrics) Sets the base codec metrics for the base codec metrics property.withBaseMetrics(BaseMetrics aBaseMetrics) Sets the base codec metrics for the base codec metrics property.Methods inherited from class AbstractConnectableAutomaton
getConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, setConnectionStatusMethods inherited from class AbstractConnectable
isThrownAsOfAlreadyClosedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Availability
hasAvailableMethods inherited from interface BaseMetricsAccessor.BaseMetricsProperty
letBaseMetricsMethods inherited from interface BytesDestination
receiveBytesMethods inherited from interface BytesReceiver
getInputStream, getInputStream, receiveBytes, receiveBytesWithin, receiveBytesWithin, receiveByteWithin, skipMethods inherited from interface Closable
closeIn, closeQuietly, closeUncheckedMethods inherited from interface Closable.CloseAutomaton
isClosableMethods inherited from interface ClosedAccessor
isClosedMethods inherited from interface ConnectionStatusAccessor
getConnectionStatus, isOpenedMethods inherited from interface Skippable
skipAvailable, skipAvailableExcept, skipAvailableTill, skipAvailableTillSilenceFor, skipAvailableTillSilenceFor, skipAvailableWithin, skipAvailableWithin, skipAvailableWithin
-
Constructor Details
-
BaseDecoder
Constructs theBaseDecoderreading the data to be decoded from the providedInputStream.- Parameters:
aInputStream- the input stream- Throws:
IOException- throw in case using theInputStreamcaused I/O related problems.
-
BaseDecoder
Constructs theBaseDecoderreading the data to be decoded from the providedInputStream.- Parameters:
aInputStream- the input streamaBaseMetrics- TheBaseMetricsto use.- Throws:
IOException- throw in case using theInputStreamcaused I/O related problems.
-
BaseDecoder
Constructs theBaseDecoderreading the data to be decoded from the providedBytesDestination.- Parameters:
aByteProvider- TheBytesDestinationfrom which to read the data.
-
BaseDecoder
Constructs theBaseDecoderreading the data to be decoded from the providedBytesReceiver.- Parameters:
aByteReceiver- TheBytesReceiverfrom which to read the data.- Throws:
IOException- in case opening or accessing an open line (connection, junction, link) caused problems.
-
BaseDecoder
public BaseDecoder(InputStreamByteReceiver aInputStreamByteReceiver, BaseMetrics aBaseMetrics) throws IOException Constructs theBaseDecoderreading the data to be decoded from the providedInputStreamByteReceiver.- Parameters:
aInputStreamByteReceiver- TheInputStreamByteReceiverto use.aBaseMetrics- TheBaseMetricsto use.- Throws:
IOException- in case opening or accessing an open line (connection, junction, link) caused problems.
-
BaseDecoder
protected BaseDecoder()Explicit default constructor.
-
-
Method Details
-
getBaseMetrics
Retrieves the base codec metrics from the base codec metrics property.- Specified by:
getBaseMetricsin interfaceBaseMetricsAccessor- Returns:
- The base codec metrics stored by the base codec metrics property.
-
setBaseMetrics
Sets the base codec metrics for the base codec metrics property.- Specified by:
setBaseMetricsin interfaceBaseMetricsAccessor.BaseMetricsMutator- Parameters:
aBaseMetrics- The base codec metrics to be stored by the font style property.
-
withBaseMetrics
Sets the base codec metrics for the base codec metrics property.- Specified by:
withBaseMetricsin interfaceBaseMetricsAccessor.BaseMetricsBuilder<BaseDecoder>- Parameters:
aBaseMetrics- The base codec metrics to be stored by the font style property.- Returns:
- The builder for applying multiple build operations.
-
available
- Specified by:
availablein interfaceAvailability- Specified by:
availablein interfaceSkippable- Throws:
IOException
-
receiveAllBytes
- Specified by:
receiveAllBytesin interfaceBytesDestination- Specified by:
receiveAllBytesin interfaceBytesReceiver- Throws:
IOException
-
receiveByte
- Specified by:
receiveBytein interfaceByteDestination- Specified by:
receiveBytein interfaceBytesDestination- Throws:
IOException
-
close
- Specified by:
closein interfaceClosable- Overrides:
closein classAbstractConnectableAutomaton- Throws:
IOException
-
open
Open.- Parameters:
aConnection- the connection- Throws:
IOException- the open exception
-