File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
src/main/java/com/fasterxml/jackson/core Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -1026,7 +1026,7 @@ public JsonFactory setCodec(ObjectCodec oc) {
1026
1026
public JsonParser createParser (File f ) throws IOException , JsonParseException {
1027
1027
// true, since we create InputStream from File
1028
1028
IOContext ctxt = _createContext (_createContentReference (f ), true );
1029
- InputStream in = _streamFromFile (f );
1029
+ InputStream in = _fileInputStream (f );
1030
1030
return _createParser (_decorate (in , ctxt ), ctxt );
1031
1031
}
1032
1032
@@ -1336,7 +1336,7 @@ public JsonGenerator createGenerator(Writer w) throws IOException {
1336
1336
@ Override
1337
1337
public JsonGenerator createGenerator (File f , JsonEncoding enc ) throws IOException
1338
1338
{
1339
- OutputStream out = new FileOutputStream (f );
1339
+ OutputStream out = _fileOutputStream (f );
1340
1340
// true -> yes, we have to manage the stream since we created it
1341
1341
IOContext ctxt = _createContext (_createContentReference (out ), true );
1342
1342
ctxt .setEncoding (enc );
Original file line number Diff line number Diff line change @@ -218,7 +218,17 @@ protected InputStream _optimizedStreamFromURL(URL url) throws IOException {
218
218
*
219
219
* @since 2.14
220
220
*/
221
- protected InputStream _streamFromFile (File f ) throws IOException {
221
+ protected InputStream _fileInputStream (File f ) throws IOException {
222
222
return new FileInputStream (f );
223
223
}
224
+
225
+ /**
226
+ * Helper methods used for constructing an {@link OutputStream} for
227
+ * generator to use, when target is to be written into given {@link File}.
228
+ *
229
+ * @since 2.14
230
+ */
231
+ protected OutputStream _fileOutputStream (File f ) throws IOException {
232
+ return new FileOutputStream (f );
233
+ }
224
234
}
You can’t perform that action at this time.
0 commit comments