Skip to content

Commit 086b039

Browse files
authored
Overwrite writeStartObject method with size field (#338)
1 parent c27450b commit 086b039

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORGenerator.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -622,8 +622,13 @@ public final void writeStartObject(Object forValue) throws IOException {
622622
}
623623

624624
public final void writeStartObject(int elementsToWrite) throws IOException {
625+
writeStartObject(null, elementsToWrite);
626+
}
627+
628+
@Override
629+
public void writeStartObject(Object forValue, int elementsToWrite) throws IOException {
625630
_verifyValueWrite("start an object");
626-
_streamWriteContext = _streamWriteContext.createChildObjectContext(null);
631+
_streamWriteContext = _streamWriteContext.createChildObjectContext(forValue);
627632
_pushRemainingElements();
628633
_currentRemainingElements = elementsToWrite;
629634
_writeLengthMarker(PREFIX_TYPE_OBJECT, elementsToWrite);

0 commit comments

Comments
 (0)