Java 8 InputStream - 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 InputStream class.

This code example shows how to use the following methods: close
    Map<String, ProcessingInstructionNode> getSocketBindingsPlaceHolders() {
        return socketBindingsPlaceHolder;
    } 
 
    void parse() throws IOException, XMLStreamException { 
        InputStream in = new BufferedInputStream(new FileInputStream(inputFile));
        try { 
            XMLInputFactory factory = XMLInputFactory.newInstance();
            factory.setProperty(XMLInputFactory.IS_COALESCING, Boolean.FALSE);
            XMLStreamReader reader = factory.createXMLStreamReader(in);
 
            reader.require(START_DOCUMENT, null, null);
            ParsingUtils.getNextElement(reader, rootElementName, null, false);
            root = super.parseNode(reader, rootElementName);
 
        } finally { 
            try { 
                in.close();
            } catch (Exception ignore) {
            } 

9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: close
        } catch (MalformedURLException e) {
            throw new AbortException("Unable to find a script "+script);
        } 
        InputStream s = url.openStream();
        try { 
            return IOUtils.toString(s);
        } finally { 
            s.close();
        } 
    } 
 
} 
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: close, mark, read, reset
				osToUse = dos;
			} 
 
			if (!isToUse.markSupported()) {
				isToUse = new BufferedInputStream(isToUse);
				isToUse.mark(1);
			} 
 
			int code = isToUse.read();
			int major;
			int minor;
 
			AbstractHessianInput in;
			AbstractHessianOutput out;
 
			if (code == 'H') {
				// Hessian 2.0 stream 
				major = isToUse.read();
				minor = isToUse.read();
				if (major != 0x02) {

8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: close
        is.reset();
    } 
 
    @Override 
    public void close() throws IOException { 
        is.close();
    } 
 
    @Override 
    public int read() throws IOException { 
        return is.read();
    } 
 
    @Override 
    public int read(byte[] b) throws IOException {
        return is.read(b);
    } 
 
    @Override 
    public int read(byte[] b, int off, int len) throws IOException {
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: available, mark, markSupported, read, reset
     * 
     * @param t            the instance of the JAXB type. 
     * @param mediaType    the meida type. 
     * @param c            the character set to serialize characters to. 
     * @param m            the marshaller to marshaller the instance of the JAXB type. 
     * @param entityStream the output stream to marshal to. 
     * @throws javax.xml.bind.JAXBException 
     */ 
    protected void writeTo(Object t, MediaType mediaType, Charset c,
                           Marshaller m, OutputStream entityStream)
            throws JAXBException { 
        m.marshal(t, entityStream);
    } 
} 

8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Java 8 InputStream Questions & Answers:

Other Java 8 InputStream Examples

16:	    setContentView(R.layout.activity_main);
17:	    ImageView button = (ImageView) findViewById(R.id.image);
18:	    InputStream resource = getResources().openRawResource(R.drawable.dog);
19:	    Bitmap bitmap = BitmapFactory.decodeStream(resource);
20:	    button.setBackground(new MyRoundCornerDrawable(bitmap));

Read More

35:	  @Override
36:	  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
37:	    InputStream stream = null;
38:	    if (requestCode == REQUEST_CODE && resultCode == Activity.RESULT_OK)
39:	      try {

Read More

4:	 
5:	public class Utils {
6:	    public static void CopyStream(InputStream is, OutputStream os)
7:	    {
8:	        final int buffer_size=1024;

Read More

4:	public class Utils {
5:	    public static void CopyStream(InputStream is, OutputStream os)
6:	    {
7:	        final int buffer_size=1024;
8:	        try

Read More

50:				Bitmap mIcon11 = null;
51:				try {
52:					InputStream in = new java.net.URL(urldisplay).openStream();
53:					mIcon11 = BitmapFactory.decodeStream(in);
54:				} catch (Exception e) {

Read More

See Code Examples for Java 8 InputStream Methods: