MCPcopy Index your code
hub / github.com/benfry/processing4 / createInput

Method createInput

core/src/processing/core/PApplet.java:6323–6342  ·  view source on GitHub ↗

This is a function for advanced programmers to open a Java InputStream. It's useful if you want to use the facilities provided by PApplet to easily open files from the data folder or from a URL, but want an InputStream object so that you can use other parts of Java to take more control of how the st

(String filename)

Source from the content-addressed store, hash-verified

6321 *
6322 */
6323 @SuppressWarnings("JavadocLinkAsPlainText")
6324 public InputStream createInput(String filename) {
6325 InputStream input = createInputRaw(filename);
6326 if (input != null) {
6327 // if it's gzip-encoded, automatically decode
6328 final String lower = filename.toLowerCase();
6329 if (lower.endsWith(".gz") || lower.endsWith(".svgz")) {
6330 try {
6331 // buffered has to go *around* the GZ, otherwise 25x slower
6332 return new BufferedInputStream(new GZIPInputStream(input));
6333
6334 } catch (IOException e) {
6335 printStackTrace(e);
6336 }
6337 } else {
6338 return new BufferedInputStream(input);
6339 }
6340 }
6341 return null;
6342 }
6343
6344
6345 /**

Callers 9

loadTableMethod · 0.95
loadFontMethod · 0.95
createReaderMethod · 0.95
loadBytesMethod · 0.95
loadStringsMethod · 0.95
TableMethod · 0.95
createFontMethod · 0.45
loadImageMethod · 0.45
loadImageIOMethod · 0.45

Calls 4

createInputRawMethod · 0.95
printStackTraceMethod · 0.95
printlnMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected