java.lang.Object
org.refcodes.component.AbstractConnectableAutomaton
org.refcodes.codec.BaseDecoderImpl
- All Implemented Interfaces:
BaseDecoder,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:
BaseDecoderImpl.BaseDecoderConnectionImpl,BaseInputStreamDecoder
public class BaseDecoderImpl extends org.refcodes.component.AbstractConnectableAutomaton implements BaseDecoder
Vanilla plain implementation of the
BaseDecoder interface to be used
with BytesReceiver instances.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBaseDecoderImpl.BaseDecoderConnectionImplVanilla plain implementation of theBaseDecoder.BaseDecoderConnectioninterface to be used withBytesDestination(BytesReceiver) instances.Nested classes/interfaces inherited from interface org.refcodes.codec.BaseDecoder
BaseDecoder.BaseDecoderConnectionNested classes/interfaces inherited from interface org.refcodes.codec.BaseMetricsAccessor
BaseMetricsAccessor.BaseMetricsBuilder<B extends BaseMetricsAccessor.BaseMetricsBuilder<B>>, BaseMetricsAccessor.BaseMetricsMutator, BaseMetricsAccessor.BaseMetricsPropertyNested classes/interfaces inherited from interface org.refcodes.io.BytesReceiver
org.refcodes.io.BytesReceiver.ReceiverInputStreamNested 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.ClosedPropertyNested classes/interfaces inherited from interface org.refcodes.component.ConnectableComponent
org.refcodes.component.ConnectableComponent.ConnectableAutomatonNested classes/interfaces inherited from interface org.refcodes.component.ConnectionStatusAccessor
org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusPropertyNested 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.InputStreamPropertyNested classes/interfaces inherited from interface org.refcodes.component.OpenedAccessor
org.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedPropertyNested 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
Constructors Modifier Constructor Description protectedBaseDecoderImpl()Explicit default constructor.BaseDecoderImpl(org.refcodes.io.BytesDestination aByteProvider)Constructs theBaseDecoderreading the data to be decoded from the providedBytesDestination.BaseDecoderImpl(org.refcodes.io.BytesReceiver aByteReceiver)Constructs theBaseDecoderreading the data to be decoded from the providedBytesReceiver. -
Method Summary
Modifier and Type Method Description intavailable()voidclose()BaseMetricsgetBaseMetrics()Retrieves the base codec metrics from the base codec metrics property.protected voidopen(org.refcodes.io.BytesDestination aConnection)Open.byte[]receiveAllBytes()bytereceiveByte()voidsetBaseMetrics(BaseMetrics aBaseMetrics)Sets the base codec metrics for the base codec metrics property.BaseDecoderwithBaseMetrics(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, setConnectionStatusMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.refcodes.io.Availability
hasAvailableMethods inherited from interface org.refcodes.codec.BaseMetricsAccessor.BaseMetricsProperty
letBaseMetricsMethods inherited from interface org.refcodes.io.BytesDestination
receiveBytesMethods inherited from interface org.refcodes.io.BytesReceiver
getInputStream, getInputStream, receiveBytes, receiveBytesWithin, receiveBytesWithin, receiveByteWithin, skipMethods inherited from interface org.refcodes.component.Closable
closeIn, closeQuietly, closeUncheckedMethods inherited from interface org.refcodes.component.Closable.CloseAutomaton
isClosableMethods inherited from interface org.refcodes.component.ClosedAccessor
isClosedMethods inherited from interface org.refcodes.component.ConnectionStatusAccessor
getConnectionStatus, isOpenedMethods inherited from interface org.refcodes.io.Skippable
skipAvailable, skipAvailableExcept, skipAvailableTill, skipAvailableTillSilenceFor, skipAvailableTillSilenceFor, skipAvailableWithin, skipAvailableWithin
-
Constructor Details
-
BaseDecoderImpl
public BaseDecoderImpl(org.refcodes.io.BytesDestination aByteProvider)Constructs theBaseDecoderreading the data to be decoded from the providedBytesDestination.- Parameters:
aByteProvider- TheBytesDestinationfrom which to read the data.
-
BaseDecoderImpl
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.
-
BaseDecoderImpl
protected BaseDecoderImpl()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 interfaceorg.refcodes.io.Availability- Specified by:
availablein interfaceorg.refcodes.io.Skippable- Throws:
IOException
-
receiveAllBytes
- Specified by:
receiveAllBytesin interfaceorg.refcodes.io.BytesDestination- Specified by:
receiveAllBytesin interfaceorg.refcodes.io.BytesReceiver- Throws:
IOException
-
receiveByte
- Specified by:
receiveBytein interfaceorg.refcodes.io.ByteDestination- Specified by:
receiveBytein interfaceorg.refcodes.io.BytesDestination- Throws:
IOException
-
close
- Specified by:
closein interfaceorg.refcodes.component.Closable- Overrides:
closein classorg.refcodes.component.AbstractConnectableAutomaton- Throws:
IOException
-
open
Open.- Parameters:
aConnection- the connection- Throws:
IOException- the open exception
-