Skip to content

Commit 169d2fb

Browse files
committed
Add one more writeStartObject() overload for Smile backend (similar to CBOR)
1 parent 5ef0368 commit 169d2fb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

smile/src/main/java/com/fasterxml/jackson/dataformat/smile/SmileGenerator.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,15 @@ public final void writeStartObject(Object forValue) throws IOException
682682
_streamWriteContext = ctxt;
683683
_writeByte(TOKEN_LITERAL_START_OBJECT);
684684
}
685-
685+
686+
@Override // since 2.14
687+
public void writeStartObject(Object forValue, int elementsToWrite) throws IOException {
688+
_verifyValueWrite("start an object");
689+
SmileWriteContext ctxt = _streamWriteContext.createChildObjectContext(forValue);
690+
_streamWriteContext = ctxt;
691+
_writeByte(TOKEN_LITERAL_START_OBJECT);
692+
}
693+
686694
@Override
687695
public final void writeEndObject() throws IOException
688696
{

0 commit comments

Comments
 (0)