Interface DecodeContext

All Known Implementing Classes:
StepEncodedInput.MetaContext, StepEncodedInput.RecordContext, StepEncodedInput.SizeContext

public interface DecodeContext

An entity that maintains the incoming stream of data to be decoded.

The main purpose of the context is to implement a data stack for unpacking MetaRecords that automatically applies MetaEvents at the correct time in the decoding proccess. Normally, the context simply defers to some underlying InputStream to fill the read requests.

See Also:
Encoder, EncodeContext

Method Summary
 Object read(Object request)
          Request data from the context.

Method Detail


public Object read(Object request)
            throws IOException
Request data from the context. This request is usually a byte[] to be filled, however it may be any encapsulated request agreed upon by the implementation and some Encoder.

request - an object representing a request for data, generally a byte[].
the filled request.
ClassCastException - if the type of request cannot be handled.
IOException - if an I/O error occurred.