Java 8 InputStreamReader - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 InputStreamReader class.

This code example shows how to use the following methods:close
    protected void parseOneInputStreamAsReader( 
            TreeImportingParserBase parser, InputStream inputStream, JSONObject options) {
        ImportColumnGroup rootColumnGroup = new ImportColumnGroup();
        List<Exception> exceptions = new ArrayList<Exception>();
         
        Reader reader = new InputStreamReader(inputStream);
        parser.parseOneFile(
            project,
            metadata,
            job,
            "file-source", 
            reader,
            rootColumnGroup,
            -1, 
            options,
            exceptions
        ); 
        postProcessProject(project, rootColumnGroup, exceptions);
         
        try { 

9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
    @Test 
    public void signedRequest() throws Exception { 
        XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM");
        Assert.assertNotNull(fac);
 
        BufferedReader br = new BufferedReader(new InputStreamReader(baseUrl.openStream()));
        Assert.assertEquals("OK", br.readLine());
    } 
} 
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
        String retStr = receiveFirstLineFromUrl(new URL(baseUrl.toString() + "?echo=HelloWorld&type=echo5"));
        Assert.assertEquals("Unexpected output - " + retStr, "HelloWorld", retStr);
    } 
 
    private String receiveFirstLineFromUrl(URL url) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
        return br.readLine();
    } 
} 
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
		verify(creator).setBlobAsBytes(preparedStatement, 1, testString.getBytes());
	} 
 
	@Test
	public void test3() throws SQLException {
		SqlLobValue lob = new SqlLobValue(new InputStreamReader(new ByteArrayInputStream("Bla".getBytes())), 12);
		thrown.expect(IllegalArgumentException.class);
		lob.setTypeValue(preparedStatement, 1, Types.BLOB, "test");
	} 
 
	@Test
	public void test4() throws SQLException {
		String testContent = "Bla";
		SqlLobValue lob = new SqlLobValue(testContent, handler);
		lob.setTypeValue(preparedStatement, 1, Types.CLOB, "test");
		verify(creator).setClobAsString(preparedStatement, 1, testContent);
	} 
 
	@Test
	public void test5() throws Exception {
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
			String templatePackage = "org/appcelerator/kroll/annotations/generator/";
 
			InputStream v8HeaderStream = loader.getResourceAsStream(templatePackage + "ProxyBindingV8.h.fm");
			InputStream v8SourceStream = loader.getResourceAsStream(templatePackage + "ProxyBindingV8.cpp.fm");
 
			v8HeaderTemplate = new Template("ProxyBindingV8.h.fm", new InputStreamReader(v8HeaderStream), fmConfig);
 
			v8SourceTemplate = new Template("ProxyBindingV8.cpp.fm", new InputStreamReader(v8SourceStream), fmConfig);
 
		} catch (IOException e) {
			e.printStackTrace();
		} 
	} 
 
	protected void saveTypeTemplate(Template template, String outFile, Map<Object, Object> root)
	{ 
		Writer writer = null;
		try { 
			File file = new File(outPath, outFile);
			System.out.println("Generating " + file.getAbsolutePath());
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:close
      throw new IOException(e.toString());
    } catch (RuntimeException e) {
      visitor.close(e);
      throw e;
    } finally { 
      fileReader.close();
    } 
  } 
   
  @Override 
  public void startDocument() { 
    state = ParseState.EXPECT_EDITS_TAG;
    stanza = null;
    stanzaStack = new Stack<Stanza>();
    opCode = null;
    cbuf = new StringBuffer();
    nextTxId = -1;
  } 
   
  @Override 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
        String retStr = receiveFirstLineFromUrl(new URL(baseUrl.toString() + "?echo=HelloWorld&type=echo5"));
        Assert.assertEquals("Unexpected output - " + retStr, "HelloWorld", retStr);
    } 
 
    private String receiveFirstLineFromUrl(URL url) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
        return br.readLine();
    } 
} 
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
	} 
 
	@Test 
	public void testSimpleTransformWithReader() throws Exception { 
		Map model = new HashMap(); 
		model.put("someKey", new InputStreamReader(getProductDataResource().getInputStream())); 
		doTestWithModel(model); 
	} 
 
	@Test 
	public void testSimpleTransformWithResource() throws Exception { 
		Map model = new HashMap(); 
		model.put("someKey", getProductDataResource()); 
		doTestWithModel(model); 
	} 
 
	@Test 
	public void testWithSourceKey() throws Exception { 
		XsltView view = getXsltView(HTML_OUTPUT); 
		view.setSourceKey("actualData"); 
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
	@Override 
	public BufferedReader getReader() throws UnsupportedEncodingException { 
		if (this.content != null) { 
			InputStream sourceStream = new ByteArrayInputStream(this.content); 
			Reader sourceReader = (this.characterEncoding != null) ? 
				new InputStreamReader(sourceStream, this.characterEncoding) : new InputStreamReader(sourceStream); 
			return new BufferedReader(sourceReader); 
		} 
		else { 
			return null; 
		} 
	} 
 
	@Override 
	public String getCharacterEncoding() { 
		return this.characterEncoding; 
	} 
 
	public void setContentType(String contentType) { 
		this.contentType = contentType; 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:close, read, ready
            if (f.length() > sizeLimit) {
                throw new IOException("File " + fileName + " length " + f.length() +
                        " exceeds limit " + sizeLimit);
            } 
            char[] buffer = new char[(int) f.length()];
            reader = new InputStreamReader(new FileInputStream(f), "UTF-8");
            int charsRead = reader.read(buffer);
            // Debug check that we've exhausted the input stream (will fail e.g. if the 
            // file grew after we inspected its length). 
            assert !reader.ready();
            return charsRead < buffer.length ? Arrays.copyOfRange(buffer, 0, charsRead) : buffer;
        } finally { 
            if (reader != null) reader.close();
        } 
    } 
} 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Java 8 InputStreamReader Questions & Answers:

Other Java 8 InputStreamReader Examples

52:	
53:			try {
54:				BufferedReader reader = new BufferedReader(new InputStreamReader(
55:						is, "iso-8859-1"), 8);
56:				StringBuilder sb = new StringBuilder();

Read More

87:	
88:			try {
89:				BufferedReader reader = new BufferedReader(new InputStreamReader(
90:						is, "UTF-8"), 8);
91:				StringBuilder sb = new StringBuilder();

Read More

72:	
73:			try {
74:				BufferedReader reader = new BufferedReader(new InputStreamReader(
75:						is, "iso-8859-1"), 8);
76:				StringBuilder sb = new StringBuilder();

Read More

See Code Examples for Java 8 InputStreamReader Methods: