Skip to content

Commit 2dee63a

Browse files
committed
Change things a bit to use helper method names 3.0 also uses
1 parent 777677d commit 2dee63a

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/main/java/com/fasterxml/jackson/core/JsonFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,7 @@ public JsonFactory setCodec(ObjectCodec oc) {
10261026
public JsonParser createParser(File f) throws IOException, JsonParseException {
10271027
// true, since we create InputStream from File
10281028
IOContext ctxt = _createContext(_createContentReference(f), true);
1029-
InputStream in = _streamFromFile(f);
1029+
InputStream in = _fileInputStream(f);
10301030
return _createParser(_decorate(in, ctxt), ctxt);
10311031
}
10321032

@@ -1336,7 +1336,7 @@ public JsonGenerator createGenerator(Writer w) throws IOException {
13361336
@Override
13371337
public JsonGenerator createGenerator(File f, JsonEncoding enc) throws IOException
13381338
{
1339-
OutputStream out = new FileOutputStream(f);
1339+
OutputStream out = _fileOutputStream(f);
13401340
// true -> yes, we have to manage the stream since we created it
13411341
IOContext ctxt = _createContext(_createContentReference(out), true);
13421342
ctxt.setEncoding(enc);

src/main/java/com/fasterxml/jackson/core/TokenStreamFactory.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,17 @@ protected InputStream _optimizedStreamFromURL(URL url) throws IOException {
218218
*
219219
* @since 2.14
220220
*/
221-
protected InputStream _streamFromFile(File f) throws IOException {
221+
protected InputStream _fileInputStream(File f) throws IOException {
222222
return new FileInputStream(f);
223223
}
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+
}
224234
}

0 commit comments

Comments
 (0)