Tabnine Logo
PApplet.createReader
Code IndexAdd Tabnine to your IDE (free)

How to use
createReader
method
in
processing.core.PApplet

Best Java code snippets using processing.core.PApplet.createReader (Showing top 20 results out of 315)

origin: ajavamind/Processing-Cardboard

/**
 * Initializes a new OBJ Object with the given filename.
 */
public PShapeOBJ(PApplet parent, String filename) {
 this(parent, parent.createReader(filename));
}
origin: ajavamind/Processing-Cardboard

/**
 * Shouldn't be part of main p5 reference, this is for advanced users.
 * Note that while it doesn't accept anything but UTF-8, this is preserved
 * so that we have some chance of implementing that in the future.
 *
 * @nowebref
 */
public XML(InputStream input, String options) throws IOException, ParserConfigurationException, SAXException {
 this(PApplet.createReader(input), options);
}
origin: org.processing/core

/**
 * Advanced users only; use loadXML() in PApplet.
 *
 * @nowebref
 */
public XML(File file, String options) throws IOException, ParserConfigurationException, SAXException {
 this(PApplet.createReader(file), options);
}
origin: ajavamind/Processing-Cardboard

/**
 * Advanced users only; see loadXML() in PApplet.
 *
 * @nowebref
 */
public XML(File file, String options) throws IOException, ParserConfigurationException, SAXException {
 this(PApplet.createReader(file), options);
}
origin: org.processing/core

/**
 * @nowebref
 */
static public BufferedReader createReader(File file) {
 try {
  InputStream is = new FileInputStream(file);
  if (file.getName().toLowerCase().endsWith(".gz")) {
   is = new GZIPInputStream(is);
  }
  return createReader(is);
 } catch (IOException e) {
  // Re-wrap rather than forcing novices to learn about exceptions
  throw new RuntimeException(e);
 }
}
origin: org.processing/core

/**
 * @nowebref
 */
static public JSONObject loadJSONObject(File file) {
 return new JSONObject(createReader(file));
}
origin: org.processing/core

/**
 * Initializes a new OBJ Object with the given filename.
 */
public PShapeOBJ(PApplet parent, String filename) {
 this(parent, parent.createReader(filename), getBasePath(parent, filename));
}
origin: org.processing/core

/**
 * @webref input:files
 * @param filename name of a file in the data folder or a URL
 * @see JSONArray
 * @see PApplet#loadJSONObject(String)
 * @see PApplet#saveJSONObject(JSONObject, String)
 * @see PApplet#saveJSONArray(JSONArray, String)
 */
public JSONArray loadJSONArray(String filename) {
 return new JSONArray(createReader(filename));
}
origin: org.processing/core

static public JSONArray loadJSONArray(File file) {
 return new JSONArray(createReader(file));
}
origin: org.processing/core

/**
 * @webref input:files
 * @param filename name of a file in the data folder or a URL
 * @see JSONObject
 * @see JSONArray
 * @see PApplet#loadJSONArray(String)
 * @see PApplet#saveJSONObject(JSONObject, String)
 * @see PApplet#saveJSONArray(JSONArray, String)
 */
public JSONObject loadJSONObject(String filename) {
 return new JSONObject(createReader(filename));
}
origin: ajavamind/Processing-Cardboard

/**
 * @webref input:files
 * @param filename name of a file in the data folder or a URL
 * @see JSONObject
 * @see JSONArray
 * @see PApplet#loadJSONArray(String)
 * @see PApplet#saveJSONObject(JSONObject, String)
 * @see PApplet#saveJSONArray(JSONArray, String)
 */
public JSONObject loadJSONObject(String filename) {
 return new JSONObject(createReader(filename));
}
origin: ajavamind/Processing-Cardboard

/**
 * @webref input:files
 * @param filename name of a file in the data folder or a URL
 * @see JSONArray
 * @see PApplet#loadJSONObject(String)
 * @see PApplet#saveJSONObject(JSONObject, String)
 * @see PApplet#saveJSONArray(JSONArray, String)
 */
public JSONArray loadJSONArray(String filename) {
 return new JSONArray(createReader(filename));
}
origin: ajavamind/Processing-Cardboard

static public JSONObject loadJSONObject(File file) {
 return new JSONObject(createReader(file));
}
origin: ajavamind/Processing-Cardboard

static public JSONArray loadJSONArray(File file) {
 return new JSONArray(createReader(file));
}
origin: org.processing/core

/**
 * @nowebref
 */
public XML loadXML(String filename, String options) {
 try {
  return new XML(createReader(filename), options);
  // can't use catch-all exception, since it might catch the
  // RuntimeException about the incorrect case sensitivity
 } catch (IOException e) {
  throw new RuntimeException(e);
 } catch (ParserConfigurationException e) {
  throw new RuntimeException(e);
 } catch (SAXException e) {
  throw new RuntimeException(e);
 }
}
origin: ajavamind/Processing-Cardboard

/**
 * I want to read lines from a file. And I'm still annoyed.
 */
static public BufferedReader createReader(File file) {
  try {
    InputStream is = new FileInputStream(file);
    if (file.getName().toLowerCase().endsWith(".gz")) {
      is = new GZIPInputStream(is);
    }
    return createReader(is);
  } catch (Exception e) {
    if (file == null) {
      throw new RuntimeException("File passed to createReader() was null");
    } else {
      e.printStackTrace();
      throw new RuntimeException("Couldn't create a reader for " +
          file.getAbsolutePath());
    }
  }
  //return null;
}
origin: ajavamind/Processing-Cardboard

/**
 * I want to read lines from a file. I have RSI from typing these
 * eight lines of code so many times.
 */
public BufferedReader createReader(String filename) {
  try {
    InputStream is = createInput(filename);
    if (is == null) {
      System.err.println(filename + " does not exist or could not be read");
      return null;
    }
    return createReader(is);
  } catch (Exception e) {
    if (filename == null) {
      System.err.println("Filename passed to reader() was null");
    } else {
      System.err.println("Couldn't create a reader for " + filename);
    }
  }
  return null;
}
origin: org.processing/core

/**
 * ( begin auto-generated from createReader.xml )
 *
 * Creates a <b>BufferedReader</b> object that can be used to read files
 * line-by-line as individual <b>String</b> objects. This is the complement
 * to the <b>createWriter()</b> function.
 * <br/> <br/>
 * Starting with Processing release 0134, all files loaded and saved by the
 * Processing API use UTF-8 encoding. In previous releases, the default
 * encoding for your platform was used, which causes problems when files
 * are moved to other platforms.
 *
 * ( end auto-generated )
 * @webref input:files
 * @param filename name of the file to be opened
 * @see BufferedReader
 * @see PApplet#createWriter(String)
 * @see PrintWriter
 */
public BufferedReader createReader(String filename) {
 InputStream is = createInput(filename);
 if (is == null) {
  System.err.println("The file \"" + filename + "\" " +
           "is missing or inaccessible, make sure " +
           "the URL is valid or that the file has been " +
           "added to your sketch and is readable.");
  return null;
 }
 return createReader(is);
}
origin: org.processing/core

int result = -1;
try {
 BufferedReader out = createReader(p.getInputStream());
 BufferedReader err = createReader(p.getErrorStream());
 result = p.waitFor();
 String line;
origin: ajavamind/Processing-Cardboard

BufferedReader reader = PApplet.createReader(input);
if (awfulCSV) {
 parseAwfulCSV(reader, header);
processing.corePAppletcreateReader

Javadoc

I want to read lines from a file. And I'm still annoyed.

Popular methods of PApplet

  • constrain
  • createGraphics
    Create an offscreen graphics surface for drawing, in this case for a renderer that writes to a file
  • loadStrings
    ( begin auto-generated from loadStrings.xml ) Reads the contents of a file or url and creates a Stri
  • saveStrings
    ( begin auto-generated from saveStrings.xml ) Writes an array of strings to a file, one line per str
  • abs
  • createImage
    ( begin auto-generated from createImage.xml ) Creates a new PImage (the datatype for storing images)
  • createShape
  • createWriter
    ( begin auto-generated from createWriter.xml ) Creates a new file in the sketch folder, and a PrintW
  • loadImage
  • main
    main() method for running this class from the command line. Usage: PApplet [options] [s
  • max
  • parseInt
  • max,
  • parseInt,
  • random,
  • round,
  • split,
  • sqrt,
  • unhex,
  • arrayCopy,
  • ceil,
  • checkExtension

Popular in Java

  • Finding current android device location
  • getResourceAsStream (ClassLoader)
  • startActivity (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now