Package org.infinispan.protostream.impl
Class ProtoStreamWriterImpl
java.lang.Object
org.infinispan.protostream.impl.ProtoStreamWriterImpl
- All Implemented Interfaces:
MessageMarshaller.ProtoStreamWriter
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intThe size of the buffer used when copying stream to stream.private static final Logprivate final SerializationContextImpl -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidCheck repeatability and write-once for a non-repeatable field.private voidCheck repeatability and write-once for a repeatable field.(package private) ProtoStreamWriterImpl.WriteMessageContextenterContext(FieldDescriptor fd, Descriptor messageDescriptor, TagWriterImpl out) (package private) voidDuring reading, a marshaller can obtain the currentImmutableSerializationContextand use it in order to access the schema or marshaller information.private voidvalidateElement(Object element, Class<?> elementClass) private voidvalidateElementClass(Class<?> elementClass, Class<?> expectedElementClass) <E> voidwriteArray(String fieldName, E[] array, Class<? extends E> elementClass) voidwriteBoolean(String fieldName, boolean value) voidwriteBoolean(String fieldName, Boolean value) voidwriteBooleans(String fieldName, boolean[] array) voidwriteBytes(String fieldName, byte[] value) voidwriteBytes(String fieldName, InputStream input) <E> voidwriteCollection(String fieldName, Collection<? super E> collection, Class<E> elementClass) voidvoidwriteDouble(String fieldName, double value) voidwriteDouble(String fieldName, Double value) voidwriteDoubles(String fieldName, double[] array) <E extends Enum<E>>
voidWrites an enum value.private <T extends Enum<T>>
voidwriteEnum(FieldDescriptor fd, T value) voidwriteFloat(String fieldName, float value) voidwriteFloat(String fieldName, Float value) voidwriteFloats(String fieldName, float[] array) private voidwriteGroup(FieldDescriptor fd, Object value, Class<?> clazz) voidwriteInstant(String fieldName, Instant value) voidvoidvoidvoidvoidvoidwriteLongs(String fieldName, long[] array) <K,V> void private voidwriteMessage(FieldDescriptor fd, Object value, Class<?> clazz) <E> voidwriteObject(String fieldName, E value, Class<? extends E> clazz) voidwriteString(String fieldName, String value)
-
Field Details
-
log
-
CHUNK_SIZE
private static final int CHUNK_SIZEThe size of the buffer used when copying stream to stream.- See Also:
-
serCtx
-
messageContext
-
-
Constructor Details
-
ProtoStreamWriterImpl
ProtoStreamWriterImpl(SerializationContextImpl serCtx)
-
-
Method Details
-
enterContext
ProtoStreamWriterImpl.WriteMessageContext enterContext(FieldDescriptor fd, Descriptor messageDescriptor, TagWriterImpl out) -
exitContext
void exitContext() -
getSerializationContext
Description copied from interface:MessageMarshaller.ProtoStreamWriterDuring reading, a marshaller can obtain the currentImmutableSerializationContextand use it in order to access the schema or marshaller information.- Specified by:
getSerializationContextin interfaceMessageMarshaller.ProtoStreamWriter
-
writeInt
- Specified by:
writeIntin interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeInt
- Specified by:
writeIntin interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeInts
- Specified by:
writeIntsin interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeLong
- Specified by:
writeLongin interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeLong
- Specified by:
writeLongin interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeLongs
- Specified by:
writeLongsin interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeDate
- Specified by:
writeDatein interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeInstant
- Specified by:
writeInstantin interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeDouble
- Specified by:
writeDoublein interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeDouble
- Specified by:
writeDoublein interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeDoubles
- Specified by:
writeDoublesin interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeFloat
- Specified by:
writeFloatin interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeFloat
- Specified by:
writeFloatin interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeFloats
- Specified by:
writeFloatsin interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeBoolean
- Specified by:
writeBooleanin interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeBoolean
- Specified by:
writeBooleanin interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeBooleans
- Specified by:
writeBooleansin interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeString
- Specified by:
writeStringin interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeBytes
- Specified by:
writeBytesin interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeBytes
- Specified by:
writeBytesin interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeObject
- Specified by:
writeObjectin interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeEnum
Description copied from interface:MessageMarshaller.ProtoStreamWriterWrites an enum value.- Specified by:
writeEnumin interfaceMessageMarshaller.ProtoStreamWriter- Parameters:
fieldName- the field namevalue- the enum value- Throws:
IOException
-
writeMessage
- Throws:
IOException
-
writeGroup
- Throws:
IOException
-
writeEnum
- Throws:
IOException
-
writeCollection
public <E> void writeCollection(String fieldName, Collection<? super E> collection, Class<E> elementClass) throws IOException - Specified by:
writeCollectionin interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeArray
public <E> void writeArray(String fieldName, E[] array, Class<? extends E> elementClass) throws IOException - Specified by:
writeArrayin interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
writeMap
public <K,V> void writeMap(String fieldName, Map<? super K, ? super V> map, Class<K> keyClass, Class<V> valueClass) throws IOException- Specified by:
writeMapin interfaceMessageMarshaller.ProtoStreamWriter- Throws:
IOException
-
validateElementClass
-
validateElement
-
checkFieldWrite
Check repeatability and write-once for a non-repeatable field. -
checkRepeatedFieldWrite
Check repeatability and write-once for a repeatable field.
-