java.lang.Object
org.refcodes.component.AbstractConnectableAutomaton
org.refcodes.codec.BaseDecoder
- All Implemented Interfaces:
BaseMetricsAccessor
,BaseMetricsAccessor.BaseMetricsBuilder<BaseDecoder>
,BaseMetricsAccessor.BaseMetricsMutator
,BaseMetricsAccessor.BaseMetricsProperty
,Decoder
,org.refcodes.component.Closable
,org.refcodes.component.Closable.CloseAutomaton
,org.refcodes.component.ClosedAccessor
,org.refcodes.component.ConnectableComponent
,org.refcodes.component.ConnectableComponent.ConnectableAutomaton
,org.refcodes.component.ConnectionStatusAccessor
,org.refcodes.component.OpenedAccessor
,org.refcodes.io.Availability
,org.refcodes.io.ByteDestination
,org.refcodes.io.ByteReceiver
,org.refcodes.io.BytesDestination
,org.refcodes.io.BytesReceiver
,org.refcodes.io.Receivable
,org.refcodes.io.Skippable
,org.refcodes.io.TimeoutInputStreamAccessor
,org.refcodes.mixin.InputStreamAccessor
- Direct Known Subclasses:
BaseDecoder.BaseDecoderConnection
public class BaseDecoder
extends org.refcodes.component.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
Modifier and TypeClassDescriptionstatic class
TheBaseDecoder.BaseDecoderConnection
implements theBaseDecoder
functionality in terms of aConnectionComponent
.Nested classes/interfaces inherited from interface org.refcodes.codec.BaseMetricsAccessor
BaseMetricsAccessor.BaseMetricsBuilder<B extends BaseMetricsAccessor.BaseMetricsBuilder<B>>, BaseMetricsAccessor.BaseMetricsMutator, BaseMetricsAccessor.BaseMetricsProperty
Nested classes/interfaces inherited from interface org.refcodes.io.BytesReceiver
org.refcodes.io.BytesReceiver.ReceiverInputStream
Nested classes/interfaces inherited from interface org.refcodes.component.Closable
org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.Closable.CloseBuilder<B extends org.refcodes.component.Closable.CloseBuilder<B>>
Nested classes/interfaces inherited from interface org.refcodes.component.ClosedAccessor
org.refcodes.component.ClosedAccessor.ClosedMutator, org.refcodes.component.ClosedAccessor.ClosedProperty
Nested classes/interfaces inherited from interface org.refcodes.component.ConnectableComponent
org.refcodes.component.ConnectableComponent.ConnectableAutomaton
Nested classes/interfaces inherited from interface org.refcodes.component.ConnectionStatusAccessor
org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.InputStreamAccessor
org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<B extends org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<?>>, org.refcodes.mixin.InputStreamAccessor.InputStreamMutator, org.refcodes.mixin.InputStreamAccessor.InputStreamProperty
Nested classes/interfaces inherited from interface org.refcodes.component.OpenedAccessor
org.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedProperty
Nested classes/interfaces inherited from interface org.refcodes.io.TimeoutInputStreamAccessor
org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<B extends org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<?>>, org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamMutator, org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamProperty
-
Constructor Summary
ModifierConstructorDescriptionprotected
Explicit default constructor.BaseDecoder
(InputStream aInputStream) Constructs theBaseDecoder
reading the data to be decoded from the providedInputStream
.BaseDecoder
(InputStream aInputStream, BaseMetrics aBaseMetrics) Constructs theBaseDecoder
reading the data to be decoded from the providedInputStream
.BaseDecoder
(org.refcodes.io.BytesDestination aByteProvider) Constructs theBaseDecoder
reading the data to be decoded from the providedBytesDestination
.BaseDecoder
(org.refcodes.io.BytesReceiver aByteReceiver) Constructs theBaseDecoder
reading the data to be decoded from the providedBytesReceiver
.BaseDecoder
(org.refcodes.io.InputStreamByteReceiver aInputStreamByteReceiver, BaseMetrics aBaseMetrics) Constructs theBaseDecoder
reading the data to be decoded from the providedInputStreamByteReceiver
. -
Method Summary
Modifier and TypeMethodDescriptionint
void
close()
Retrieves the base codec metrics from the base codec metrics property.protected void
open
(org.refcodes.io.BytesDestination aConnection) Open.byte[]
byte
void
setBaseMetrics
(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 org.refcodes.component.AbstractConnectableAutomaton
getConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, setConnectionStatus
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.refcodes.io.Availability
hasAvailable
Methods inherited from interface org.refcodes.codec.BaseMetricsAccessor.BaseMetricsProperty
letBaseMetrics
Methods inherited from interface org.refcodes.io.BytesDestination
receiveBytes
Methods inherited from interface org.refcodes.io.BytesReceiver
getInputStream, getInputStream, receiveBytes, receiveBytesWithin, receiveBytesWithin, receiveByteWithin, skip
Methods inherited from interface org.refcodes.component.Closable
closeIn, closeQuietly, closeUnchecked
Methods inherited from interface org.refcodes.component.Closable.CloseAutomaton
isClosable
Methods inherited from interface org.refcodes.component.ClosedAccessor
isClosed
Methods inherited from interface org.refcodes.component.ConnectionStatusAccessor
getConnectionStatus, isOpened
Methods inherited from interface org.refcodes.io.Skippable
skipAvailable, skipAvailableExcept, skipAvailableTill, skipAvailableTillSilenceFor, skipAvailableTillSilenceFor, skipAvailableWithin, skipAvailableWithin, skipAvailableWithin
-
Constructor Details
-
BaseDecoder
Constructs theBaseDecoder
reading the data to be decoded from the providedInputStream
.- Parameters:
aInputStream
- the input stream- Throws:
IOException
- throw in case using theInputStream
caused I/O related problems.
-
BaseDecoder
Constructs theBaseDecoder
reading the data to be decoded from the providedInputStream
.- Parameters:
aInputStream
- the input streamaBaseMetrics
- TheBaseMetrics
to use.- Throws:
IOException
- throw in case using theInputStream
caused I/O related problems.
-
BaseDecoder
public BaseDecoder(org.refcodes.io.BytesDestination aByteProvider) Constructs theBaseDecoder
reading the data to be decoded from the providedBytesDestination
.- Parameters:
aByteProvider
- TheBytesDestination
from which to read the data.
-
BaseDecoder
Constructs theBaseDecoder
reading the data to be decoded from the providedBytesReceiver
.- Parameters:
aByteReceiver
- TheBytesReceiver
from which to read the data.- Throws:
IOException
- in case opening or accessing an open line (connection, junction, link) caused problems.
-
BaseDecoder
public BaseDecoder(org.refcodes.io.InputStreamByteReceiver aInputStreamByteReceiver, BaseMetrics aBaseMetrics) throws IOException Constructs theBaseDecoder
reading the data to be decoded from the providedInputStreamByteReceiver
.- Parameters:
aInputStreamByteReceiver
- TheInputStreamByteReceiver
to use.aBaseMetrics
- TheBaseMetrics
to 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:
getBaseMetrics
in 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:
setBaseMetrics
in 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:
withBaseMetrics
in 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:
available
in interfaceorg.refcodes.io.Availability
- Specified by:
available
in interfaceorg.refcodes.io.Skippable
- Throws:
IOException
-
receiveAllBytes
- Specified by:
receiveAllBytes
in interfaceorg.refcodes.io.BytesDestination
- Specified by:
receiveAllBytes
in interfaceorg.refcodes.io.BytesReceiver
- Throws:
IOException
EOFException
-
receiveByte
- Specified by:
receiveByte
in interfaceorg.refcodes.io.ByteDestination
- Specified by:
receiveByte
in interfaceorg.refcodes.io.BytesDestination
- Throws:
IOException
EOFException
-
close
- Specified by:
close
in interfaceorg.refcodes.component.Closable
- Overrides:
close
in classorg.refcodes.component.AbstractConnectableAutomaton
- Throws:
IOException
-
open
Open.- Parameters:
aConnection
- the connection- Throws:
IOException
- the open exception
-