Skip to content

Commit e1c8478

Browse files
committed
Fix #180: add ProtobufGenerator.canWriteBinaryNatively()
1 parent 578d3ab commit e1c8478

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

protobuf/src/main/java/com/fasterxml/jackson/dataformat/protobuf/ProtobufGenerator.java

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,22 @@ public Version version() {
175175
return PackageVersion.VERSION;
176176
}
177177

178+
/*
179+
/**********************************************************
180+
/* Capability introspection
181+
/**********************************************************
182+
*/
183+
184+
@Override // since 2.10
185+
public boolean canWriteBinaryNatively() {
186+
return true;
187+
}
188+
189+
@Override
190+
public boolean canUseSchema(FormatSchema schema) {
191+
return (schema instanceof ProtobufSchema);
192+
}
193+
178194
/*
179195
/**********************************************************
180196
/* Overridden methods, configuration
@@ -211,11 +227,6 @@ public int getOutputBuffered() {
211227
return -1;
212228
}
213229

214-
@Override
215-
public boolean canUseSchema(FormatSchema schema) {
216-
return (schema instanceof ProtobufSchema);
217-
}
218-
219230
@Override public ProtobufSchema getSchema() {
220231
return _schema;
221232
}

release-notes/VERSION-2.x

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Project: jackson-datatypes-binaryModules:
1414
(suggested by MrThreepwood@github)
1515
#178: Fix issue wit input offsets when parsing CBOR from `InputStream`
1616
(reported by iziamos@github)
17+
#180: Add `ProtobufGenerator.canWriteBinaryNatively()` to support binary writes
1718

1819
2.10.0.pr2 (31-Aug-2019)
1920

0 commit comments

Comments
 (0)