Package org.infinispan.protostream
Interface MessageMarshaller.ProtoStreamWriter
-
- Enclosing interface:
- MessageMarshaller<T>
public static interface MessageMarshaller.ProtoStreamWriter
A high-level interface for the wire encoding of a Protobuf stream that allows writing named (and typed) message fields.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description ImmutableSerializationContext
getSerializationContext()
During reading, a marshaller can obtain the currentImmutableSerializationContext
and use it in order to access the schema or marshaller information.<E> void
writeArray(String fieldName, E[] array, Class<? extends E> elementClass)
void
writeBoolean(String fieldName, boolean value)
void
writeBoolean(String fieldName, Boolean value)
void
writeBooleans(String fieldName, boolean[] values)
void
writeBytes(String fieldName, byte[] value)
void
writeBytes(String fieldName, InputStream input)
<E> void
writeCollection(String fieldName, Collection<? super E> collection, Class<E> elementClass)
void
writeDate(String fieldName, Date value)
void
writeDouble(String fieldName, double value)
void
writeDouble(String fieldName, Double value)
void
writeDoubles(String fieldName, double[] values)
<E extends Enum<E>>
voidwriteEnum(String fieldName, E value)
Writes an enum value.<E extends Enum<E>>
voidwriteEnum(String fieldName, E value, Class<E> clazz)
Deprecated.replaced bywriteEnum(String fieldName, Enum value)
void
writeFloat(String fieldName, float value)
void
writeFloat(String fieldName, Float value)
void
writeFloats(String fieldName, float[] values)
void
writeInstant(String fieldName, Instant value)
void
writeInt(String fieldName, int value)
void
writeInt(String fieldName, Integer value)
void
writeInts(String fieldName, int[] values)
void
writeLong(String fieldName, long value)
void
writeLong(String fieldName, Long value)
void
writeLongs(String fieldName, long[] values)
<E> void
writeObject(String fieldName, E value, Class<? extends E> clazz)
void
writeString(String fieldName, String value)
-
-
-
Method Detail
-
getSerializationContext
ImmutableSerializationContext getSerializationContext()
During reading, a marshaller can obtain the currentImmutableSerializationContext
and use it in order to access the schema or marshaller information.
-
writeInt
void writeInt(String fieldName, int value) throws IOException
- Throws:
IOException
-
writeInt
void writeInt(String fieldName, Integer value) throws IOException
- Throws:
IOException
-
writeInts
void writeInts(String fieldName, int[] values) throws IOException
- Throws:
IOException
-
writeLong
void writeLong(String fieldName, long value) throws IOException
- Throws:
IOException
-
writeLong
void writeLong(String fieldName, Long value) throws IOException
- Throws:
IOException
-
writeLongs
void writeLongs(String fieldName, long[] values) throws IOException
- Throws:
IOException
-
writeDate
void writeDate(String fieldName, Date value) throws IOException
- Throws:
IOException
-
writeInstant
void writeInstant(String fieldName, Instant value) throws IOException
- Throws:
IOException
-
writeDouble
void writeDouble(String fieldName, double value) throws IOException
- Throws:
IOException
-
writeDouble
void writeDouble(String fieldName, Double value) throws IOException
- Throws:
IOException
-
writeDoubles
void writeDoubles(String fieldName, double[] values) throws IOException
- Throws:
IOException
-
writeFloat
void writeFloat(String fieldName, float value) throws IOException
- Throws:
IOException
-
writeFloat
void writeFloat(String fieldName, Float value) throws IOException
- Throws:
IOException
-
writeFloats
void writeFloats(String fieldName, float[] values) throws IOException
- Throws:
IOException
-
writeBoolean
void writeBoolean(String fieldName, boolean value) throws IOException
- Throws:
IOException
-
writeBoolean
void writeBoolean(String fieldName, Boolean value) throws IOException
- Throws:
IOException
-
writeBooleans
void writeBooleans(String fieldName, boolean[] values) throws IOException
- Throws:
IOException
-
writeString
void writeString(String fieldName, String value) throws IOException
- Throws:
IOException
-
writeBytes
void writeBytes(String fieldName, byte[] value) throws IOException
- Throws:
IOException
-
writeBytes
void writeBytes(String fieldName, InputStream input) throws IOException
- Throws:
IOException
-
writeObject
<E> void writeObject(String fieldName, E value, Class<? extends E> clazz) throws IOException
- Throws:
IOException
-
writeEnum
@Deprecated <E extends Enum<E>> void writeEnum(String fieldName, E value, Class<E> clazz) throws IOException
Deprecated.replaced bywriteEnum(String fieldName, Enum value)
Writes an enum value. The third argument (theclass
was never used internally) so this variant is now deprecated.- Throws:
IOException
-
writeEnum
<E extends Enum<E>> void writeEnum(String fieldName, E value) throws IOException
Writes an enum value.- Parameters:
fieldName
- the field namevalue
- the enum value- Throws:
IOException
-
writeCollection
<E> void writeCollection(String fieldName, Collection<? super E> collection, Class<E> elementClass) throws IOException
- Throws:
IOException
-
writeArray
<E> void writeArray(String fieldName, E[] array, Class<? extends E> elementClass) throws IOException
- Throws:
IOException
-
-