|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FudgeStreamWriter
Abstract interface for writing Fudge elements to a target. This base can be used to build full Fudge message writers or serializers to convert Java objects directly to Fudge streams.
Method Summary | |
---|---|
void |
close()
Flushes and closes this writer and attempts to close the underlying stream if appropriate. |
void |
envelopeComplete()
Signal the end of the message contained within an envelope. |
void |
flush()
Flushes any data from the internal buffers to the target stream and attempts to flush the underlying stream if appropriate. |
FudgeTaxonomy |
getCurrentTaxonomy()
Returns the taxonomy (if any) that is currently being used to encode fields. |
int |
getCurrentTaxonomyId()
Returns the current taxonomy identifier. |
FudgeContext |
getFudgeContext()
Returns the bound FudgeContext used for type and taxonomy resolution. |
void |
setCurrentTaxonomyId(int taxonomyId)
Sets the current taxonomy, by identifier, to be used to encode fields. |
void |
writeEnvelopeHeader(int processingDirectives,
int schemaVersion,
int messageSize)
Writes a message envelope header. |
void |
writeField(FudgeField field)
Writes a message field. |
void |
writeField(Short ordinal,
String name,
FudgeFieldType<?> type,
Object fieldValue)
Writes a message field. |
void |
writeFields(FudgeFieldContainer fields)
Writes a set of fields. |
Method Detail |
---|
FudgeContext getFudgeContext()
FudgeContext
used for type and taxonomy resolution.
FudgeContext
FudgeTaxonomy getCurrentTaxonomy()
null
if no taxonomy is specified or the taxonomy identifier cannot be resolved by the bound FudgeContext
.
FudgeTaxonomy
void setCurrentTaxonomyId(int taxonomyId)
taxonomyId
- the taxonomy identifierint getCurrentTaxonomyId()
void writeEnvelopeHeader(int processingDirectives, int schemaVersion, int messageSize)
processingDirectives
- the processing directive flagsschemaVersion
- the schema version valuemessageSize
- the Fudge encoded size of the underlying message, including the message envelopevoid envelopeComplete()
void writeField(FudgeField field)
field
- the message field to writevoid writeField(Short ordinal, String name, FudgeFieldType<?> type, Object fieldValue)
ordinal
- the ordinal index of the field, or null
to omit.name
- the name of the field, null
to omit. If the ordinal is omitted and the name matches an entry in the current taxonomy the name will be replaced by the taxonomy resolved ordinal.type
- the type of the underlying datafieldValue
- value of the fieldvoid writeFields(FudgeFieldContainer fields)
fields
- the fields to write.void flush()
flush
in interface Flushable
void close()
close
in interface Closeable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |