Java ZipOutputStream to InputStream

OutputStream -> byte[] -> InputStream. E.g. //OutputStream ByteArrayOutputStream outStream = new ByteArrayOutputStream(new File(outputFile)); //byte[] -> InputStream ByteArrayInputStream inStream = new ByteArrayInputStream( outStream.toByteArray() ) This is the simplest way to convert from OutputStream to InputStream in java. 2. Copy OutputStream to InputStream Using NIO Channel ZipOutputStream is used to write ZipEntrys to the underlying stream. Output from ZipOutputStream can be read using ZipFileor ZipInputStream. While DeflaterOutputStream can write compressed zip file entries, this extension can write uncompressed entries as well. Use ZipEntry#setMethod or #setMethod with the ZipEntry#STORED flag Following on from one of our popular articles on 1 weve put together a new article on how to create a zip archive using Java. The below example uses ZipOutputStream to create a zip file from all the items in a directory. Zip files are written slightly differently to a normal stream in that each entry is put into the stream one at a time. So the procedure is as follows: Create a zip archive using ZipOutputStream Create a new ZipEntry to represent the file to be added Write the. ZipOutputStream zout = new ZipOutputStream(fout); //create object of FileInputStream for source file. FileInputStream fin = new FileInputStream(sourceFile); /*. * To begin writing ZipEntry in the zip file, use. *. * void putNextEntry (ZipEntry entry) * method of ZipOutputStream class. * The java.util.zip.ZipFile.getInputStream(ZipEntry entry) method returns an input stream for reading the contents of the specified zip file entry. Declaration. Following is the declaration for java.util.zip.ZipFile.getInputStream(ZipEntry entry) method. public InputStream getInputStream(ZipEntry entry) throws IOException Parameter

In the first while loop, we go through the entries of the ZIP file. while ( (len = stream.read (buffer)) > 0) { bos.write (buffer, 0, len); } In the second while loop, we read the entries and write them to the output stream. In this tutorial, we have presented the Java ZipInputStream class String outFilename = outfile.zip; out = new ZipOutputStream ( new FileOutputStream (outFilename) ); for (int i=0; i<filenames.size (); i++) {. byte[] buffer = filenames.get (i).getAttachment (); ZipEntry zipEntry = new ZipEntry (filenames.get (i).getTitle ()); out.putNextEntry ( zipEntry ); out.write (buffer) That's it! The OutputStream has been converted to an InputStream. Method 2: Use pipes. The problem with the first method is that you must actually have enough memory to buffer the entire amount of data. You could buffer larger amounts of data by using the filesystem rather than memory, but either way there is a hard limit to the size of the data that can be handled. The solution is create a thread to produce the data to the PipedOutputStream. The current thread can then read the data as it. 方法一:使用byte array缓存转换. 代码示例如下. ByteArrayOutputStream baos = new ByteArrayOutputStream(); ByteArrayInputStream swapStream = new ByteArrayInputStream(baos.toByteArray()); 这种方式最为简单,但是要求执行 baos.toByteArray () 这个方法之前,需要的数据已经完全写入,即无法做到边写边读,另外其需要足够的内存来一次性的容纳这些数据。

The java.util.zip.ZipInputStream.read(byte[] buf, int off, int len) method reads from the current ZIP entry into an array of bytes. If len is not zero, the method blocks until some input is available; otherwise, no bytes are read and 0 is returned. Declaratio Java.util.zip.ZipOutputStream class in Java. This class implements an output stream filter for writing files in the ZIP file format. Includes support for both compressed and uncompressed entries. ZipOutputStream (OutputStream out) : Creates a new ZIP output stream. ZipOutputStream (OutputStream out, Charset charset) : Creates a new ZIP output.

Used to read (decompress) the data from zip files. A zip file (or archive) is a collection of (possibly) compressed files. When reading from a ZipInputStream, you call #getNextEntrywhich returns a ZipEntry of metadata corresponding to the userdata that follows In Java 9 or higher, you can use the InputStream.transferTo() method to copy data from InputStream to OutputStream. This method reads all bytes from this input stream and writes the bytes to the given output stream in the original order OutputStream is part of the Java IO API which defines classes required to perform I/O operations in Java. These are all packaged in the java.io namespace. This is one of the core packages available in Java since version 1.0. Starting Java 1.4, we also have Java NIO packaged in the namespace java.nio which enables non-blocking input and output operations

Java Convert OutputStream to InputStream Exampl

File zipFile = new File ( d: + File.separator + liuxun.zip) ; // 定义压缩文件名称. InputStream input = new FileInputStream (file) ; // 定义文件的输入流. ZipOutputStream zipOut = null ; // 声明压缩流对象. zipOut = new ZipOutputStream ( new FileOutputStream (zipFile)) ; zipOut.putNextEntry ( new ZipEntry (file.getName ())) ; // 设置ZipEntry对象 Closeable, AutoCloseable. Direct Known Subclasses: JarInputStream. public class ZipInputStream extends InflaterInputStream. This class implements an input stream filter for reading files in the ZIP file format. Includes support for both compressed and uncompressed entries File zipFile = new File (d: File.separator mldn.zip) ; // 定義壓縮檔名稱. InputStream input = new FileInputStream (file) ; // 定義檔案的輸入流. ZipOutputStream zipOut = null ; // 宣告壓縮流物件. zipOut = new ZipOutputStream (new FileOutputStream (zipFile)) ; zipOut.putNextEntry (new ZipEntry (file.getName ())) ; // 設定ZipEntry物件 Class ZipOutputStream in Java. ZipOutputStream class is a subclass of DeflaterOutputStream that writes data in the ZIP file format to an output stream. The ZipOutputStream class writes compressed files in the ZIP format. To write a ZIP file, construct a ZipOutputStream that wraps a regular output stream. You have to create a ZipEntry for each.

Simple enough using the java.util.zip package, or so I thought. File generated successfully, openable in jZip in the format I wanted. Excellent. Unfortunately the process fails because the size of the first file in the archive gets returned as -1, which causes a NegativeArraySizeException (it tries to create a byte array the size of the file. Don't ask me why) Whats even crazier is if I unzip. public InputStream getCompressed(InputStream is) throws IOException { byte data[] = new byte[2048]; ByteArrayOutputStream bos = new ByteArrayOutputStream(); ZipOutputStream zos = new ZipOutputStream(bos); BufferedInputStream entryStream = new BufferedInputStream(is, 2048); ZipEntry entry = new ZipEntry(); zos.putNextEntry(entry); int count; while ((count = entryStream.read(data, 0, 2048)) != -1) { zos.write(data, 0, count); } entryStream.close(); zos.closeEntry(); zos.close.

java.util.zip.ZipOutputStream java code examples Tabnin

使用java.io.PipedInputStream和的优点java.io.PipedOutputStream是没有额外的内存消耗。ByteArrayOutputStream.toByteArray()返回原始缓冲区的副本,这意味着内存中的任何内容现在都有两个副本。然后写一个数据InputStream意味着您现在有了数据的三个副本。编.. The following examples show how to use java.util.zip.ZipOutputStream. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar. Example 1. Source Project: javacore Source File. The following examples show how to use java.util.zip.zipoutputstream#putNextEntry() .These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example

Class ZipOutputStream in Java. January 8, 2020. Animesh Chatterje Java framework has provided couple of classes to zip a file(s). ZipOutputStream: ZipOutputStream class implements an output stream filter for writing files in ZIP file format. ZipEntry: ZipEntry class represents an entry of ZIP file. 1. Program flow: Zip input directory (sub-directories

Java has direct support for the ZIP file format. Typically, we would be using the following four classes from the java.util.zip package to work with the ZIP file format This Java example shows how create zip file from directory recursively using Java ZipOutputStream class. This program also shows how to add directory and sub-directories to zip file This article is part of the Java - Back to Basic series here on Baeldung. 2. Convert Using Java. First - let's look at the Java solution: 3. Convert Using Guava. Next - let's use wrap the byte array into the Guava ByteSource - which then allows us to get the stream: And there you have it - a simple way of opening an InputStream.

Writing a zip file in java using ZipOutputStream

copyLarge(InputStream, OutputStream, byte[]) NOTE: the method checks that the length can safely be cast to an int without truncation before using toByteArray(java.io.InputStream, int) to read into the byte array. (Arrays can have no more than Integer.MAX_VALUE entries anyway) Parameters: input - the InputStream to read from size - the size of InputStream Returns: the requested byte array. Zip InputStream 和 ZipOutputStream 定义 压缩 流 在日常中经常会使用到zip或rar这样的 压缩 文件,更加便利了我们日常文件的传输和使用。. 当然在java中 也提供了相应的输入输出流来 压缩 和解压gzip、zip和rar这样的文件。. Zip InputStream 压缩 文件输入流,用于读取. This page provides Java code examples for java.util.zip.ZipOutputStream. The examples are extracted from open source Java projects from GitHub. Popular Classes. S ources - E xamples - D iscussions. Java Code Examples for java.util.zip.ZipOutputStream. The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you. Example 1. Zipping single fie in Java using ZipOutputStream. The steps for zipping a file using ZipOutputStream are as follows- Create an InputStream for reading the source file. Create an OutputStream for the zip file and wrap it in a ZipOutputStream object. Create a ZipEntry instance for the source file and add it to the ZipOutputStream. Read data from the source file and write it to the ZIP file.

Using java.io.ByteArrayOutputStream. 1.1 This Java example uses java.util.zip.ZipOutputStream to zip a single file. String to InputStream. Complexity: Popularity: Usage examples: The Decorator is pretty standard in Java code, especially in code related to streams. In order to convert a byte array to an image we need to follow these following steps: Create a ByteArrayInputStream object. java.io. Java FileInputStream constructors. These are FileInputStream constructors: . FileInputStream(File file) — creates a file input stream to read from a File object. FileInputStream(String name) — creates a file input stream to read from the specified file name. FileInputStream(FileDescriptor fdObj) — creates a file input read from the specified file descriptor

Create Zip File using ZipOutputStream Example Java

  1. Zip a file - java.util.zip. Zip a folder - File tree and java.util.zip. Java 7 introduced the Zip File System Provider, combines with Files.copy, we can copy the file attributes into the zip file easily (see example 4). 1. Zip a single file - java.util.zip. 1.1 This Java example uses java.util.zip.ZipOutputStream to zip a single file
  2. Contribute to YizhuoLu/Java-Input-and-output-stream-learning development by creating an account on GitHub
  3. 1、瞭解壓縮流的主要作用 2、瞭解JAVA IO 支援的三種壓縮格式 3、掌握ZipOutputStream、ZipFile、ZipInputStream 三個類的作用 具體內容 經常可以看見各種壓縮檔案:zip、jar、GZ、 正常情況下在IO 操作中,所有的類庫都是在 IO 包中。 在例項化ZipEntr
  4. import java.io.InputStream; import java.util.ArrayList; import net.lingala.zip4j.io.ZipOutputStream; import net.lingala.zip4j.model.ZipParameters; import net.lingala.zip4j.util.Zip4jConstants; /** * This example demonstrates the use of ZipOutputStreams. * ZipOutputStreams can be used to create zip files on the fly * with all compression and encryption being done in memory */ public class.
  5. ZIP file generation in java is straight forward. You need a ZipOutputStream that takes a FileOutputStream witch takes the output name of the file. Using this with try with resources is very clever because we don't need to handle the closing of our streams. The JVM handles this for us witch results in cleaner and more readable code. After our ZipOutputStream is created we Iterate over the.
  6. HandlerStream.java - Takes an InputStream and OutputStream as input. Description. The value byte is returned in the range 0 to 255. The OutputStream class of the java.io package is an abstract superclass that represents an output stream of bytes.. Both classes are explained in my Java IO tutorial. The OutputStream class of the java.io package is an abstract superclass that represents an.
  7. Java之解压流(ZipInputStream). 一、ZipInputStream相对于ZipOutputStream而言,使用上面简单的多了,相对的,既然存在压缩流,就会存在,解压的方式。. 二、解压文件,流的使用过程中也是很常用的,在读取文件,根据文件类型进行处理,这样,就可以做到,最低成本.

java.util.zip.ZipFile.getInputStream() Method Exampl

java zipinputstream byte array

Founder at Kode Java Org I am a programmer, a runner, a recreational diver, currently live in the island of Bali , Indonesia . Mostly programming in Java, Spring Framework, Hibernate / JPA Find changesets by keywords (author, files, the commit message), revision number or hash, or revset expression 程序员小明的日常开发. Contribute to WhenCoding/coder-xiaoming development by creating an account on GitHub

私はjava.util.zip.ZipInputStreamから1つのファイルを読み込み、 java.io.ByteArrayOutputStreamコピーしようとしています( java.io.ByteArrayInputStreamを作成してサードパーティのライブラリに渡すことができます)。ストリームを閉じることになり、 ZipInputStreamが閉じられないようにしZipInputStream ) Uses of OutputStream in java.io. The class implements a buffered output stream. This class implements an output stream in which the data is written into a byte array. A data output stream lets an application write primitive Java data types to an output stream in a portable way Java で ZipOutputStream を byte配列へ変換したい . 解決済. 回答 1. 投稿 2020/02/17 22:43. 評価 ; クリップ 0; VIEW 3,218; tsukari. score 7 . zip ファイルの中のファイルの内容を少し変更して、変更した zip ファイルを BLOB 型のカラムに保存しようと考えています。 zip ファイルの読み込みには、ZipInputStream、ZipEntry. Amazon S3 Uploading via Java API : InputStream Sources. I'm testing different ways to upload small objects toS3 using aws-java-sdk-s3. Being small objects I use the default api (the Transfer API for large and huge objects....) Uploading a File as a source, perfect ! File file =. Uploading ByteArrayInputStream, perfect import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.InputStrea (转)java中outputStream与inputStream的相互转换 - LatteYan - 博客园 首

Java ZipInputStream - reading ZIP files in Jav

Java ZipOutputStream.putNextEntry使用的例子?那麽恭喜您, 這裏精選的方法代碼示例或許可以為您提供幫助。. 您也可以進一步了解該方法所在 類java.util.zip.ZipOutputStream 的用法示例。. 在下文中一共展示了 ZipOutputStream.putNextEntry方法 的18個代碼示例,這些例子默認根據受. 17 Java IO Interview Questions And Answers - Input Output in Java Interview Questions For Experienced from Codingcompiler.Test your Java I/O knowledge by answering these tricky interview questions on Java IO.. Let's start learning Java IO interview questions and prepare for Java interviews.All the best for your future and happy learning.. zipファイルの作成(圧縮) zipファイルを作成するには、ZipOutputStreamというクラスを使う。 (標準ライブラリならjava.util.zip.ZipOutputStream、Antのならorg.apache.tools.zip.ZipOutputStream). ZipOutputStreamは素直にnewでインスタンスを作成するのだが、Ant版ではコンストラクターがちょっと違う

InputStream / OutputStream はバイナリデータのストリームです。 byte[] で読み書きします。 Reader / Writer はテキストデータのストリームです java bytearray inputstream outputstream GuruKulki · Jan 19, 2010 · Viewed 285.8k times · Source I have a blob column in my database table, for which I have to use byte[] in my Java program as a mapping and to use this data I have to convert it to InputStream or OutputStream java怎样使用ZipOutputStream和ZipInputStream压缩和解压缩 如题想用ZipOutputStream和ZipInputStream进行压缩和解压缩,最简单的那种就行。 给个例子,太难的看懂有些困难 JDK; JDK-6487095; URLClassLoader fails to reload resources from dynamically changed jar-file

Converting ZipOutputStream to byte[] or

Convert a Java OutputStream to an InputStream - Stephen

In Java, you can use a ZipInputStream to read a ZIP archive. You need to look at the individual entries in the archive. The getNextEntry method returns an object of type ZipEntry that describes the entry. Pass the entry to the getInputStream method of the ZipInputStream to obtain an input stream for reading the entry. Then call closeEntry to read the next entry. Here is a typical code sequence. In this tutorial, we show how to create a zip file from multiple files in Java. 1- ByteArrayOutputStream & ZipOutputStream. Using ByteArrayOutputStream and ZipOutputStream classes provided by the JDK, you can generate a zip file out of multiple files. The following utility method accepts a list of File objects and generates a zip file as a byte. ZipEntry entry = zip.getEntry (anEntry.name); InputStream is = zip.getInputStream (entry); Now that you've seen how to create the zip file and add entries to that file, it is important to point out that the java.util.zip libraries offer some level of control for the added entries of the ZipOutputStream Simple ZipOutputStream Example. GitHub Gist: instantly share code, notes, and snippets. Skip to content . All gists Back to GitHub Sign in Sign up Sign in Sign up {{ message }} Instantly share code, notes, and snippets. yanaga / JavaZip.java. Created Jan 9, 2012. Star 0 Fork 0; Star Code Revisions 1. Embed. What would you like to do? Embed Embed this gist in your website. Share Copy sharable. Java create zip file in memory. Create a Zip File in Memory, Create a Zip File in Memory · java memory zip inputstream. I'm trying to zip a file ( for example foo.csv) and upload it to Use ByteArrayOutputStream with ZipOutputStream to accomplish the task. you can use ZipEntry to specify the files to be included into the zip file

Java中3种OutputStream转InputStream的方法 - 简

bruce springsteen zip hoodie

java.util.zip.ZipInputStream.read() Method Exampl

Java Code Examples for java.util.zip.CRC32. The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you java.util.zip.ZipOutputStream による ZIP アーカイブ 1. GitHub Gist: instantly share code, notes, and snippets import java.io.BufferedOutputStream import java.io.File import java.io.FileInputStream import java.io.FileOutputStream import java.nio.charset.Charset import java.util.zip.ZipEntry import java.util.zip.ZipOutputStream /** * 指定された ArrayList のファイルを ZIP アーカイブし、指定されたパスに作成します。 。 * デフォルト文字コードは Shift_JIS ですの. java.util.zip.ZipOutputStream による ZIP アーカイブ 2. GitHub Gist: instantly share code, notes, and snippets

dian fossey zivotopis

Java.util.zip.ZipOutputStream class in Java - GeeksforGeek

Previously in our tutorial, we learned how we can compress files in GZIP in Java. Today, we will be showing you how you can compress files in ZIP in Java. This will be using the Java API and will not use any external libraries. Compress Files in ZIP in Java. We will be using the ZipOutputStream in Java to copy each files. Here's the sample code I/O-Grundlagen: import java.io.*; Die mitStream endenden Klassen lesen und schreiben Binärdaten und die mitReader/...Writer endenden Textzeichen. Streaming data is a radical new approach to sending data to web browsers which provides for dramatically faster page load times. Quite often, we need to allow users to download files in we

java.util.zip.ZipInputStream java code examples Tabnin

  1. Java関連. java でzip圧縮する方法のメモ。. ググれば出てくるけど、自分用のメモのために。. 基本的には、. 圧縮対象のファイルをもとにZipEntryをつくる. ZipOutputStream#putNextEntryにZipEntryを格納する. 対象ファイルをInputStream#readで全部読み込み、ZipOutputStream#writeに.
  2. The java.util.zip.ZipOutputStream class allows you to compress data and write the result to an underlying java.io.OutputStream object. The SharpZip application is intended to work with files, so it writes the compressed data to a new java.io.FileOutputStream object, but you could easily derive your own class from java.io.OutputStream or use one of the standard classes to write the compressed.
  3. How to convert multiple files in java to .zip format. i receive multiple files from a remote URL as . for (String reportid : reportList) { inputStream = AWSFileUtil.getInputStream( AWSConnectionUtil.getS3Object(null), cdn.generalsentiment.com, filePath); } i want to convert the data from inputStream into Zip Stream and so as to make it available for download. View Answers. February 6, 2012.
  4. 1.1. Create an InputStream for the file named fileName located in the filePath directory. 1.2. Create a new ZipEntry, using fileName as the name after converting it to a String. 1.3. Copy the data from the InputStream ( from step 1.1) to the zipOutputStream parameter. 1.4
  5. Hi, Would anyone have a java service/s they're willing to share which will Zip (compress) data in memory (without having to write the data to a file first) and Unzip (decompress) data in memory also ?? Ideally, what I want to do is to pass a text STRING (representing a file that has already been read into memory) into a service and that service will pass back compressed BYTEs. This data.
dian fossey wayne mcguire

How to convert InputStream to OutputStream in Jav

Guide to Java OutputStream Baeldun

  1. Hier ist eine ziemlich knappe Java 7+ -Lösung, die ausschließlich auf JDK-Klassen von Vanille angewiesen ist und keine Bibliotheken von Drittanbietern benötigt: public static void pack (final Path folder, final Path zipFilePath) throws IOException { try ( FileOutputStream fos = new FileOutputStream (zipFilePath.toFile ()); ZipOutputStream.
  2. Das mit dem static ist zwar nicht so toll, aber einfacher Getestet habe ich den Code mit Eclipse unter Windows. Wenn du das verwenden willst, ab besten die Konsolenausgaben rausnehmen, ansonsten kannst du das, wenn du es selber machst, vielleicht sogar noch besser lösen
  3. How to get parameters from Java Properties File. Published on May 13, 2016 by Daniel Lanza. java. Parameters are read from Java properties file and printed on console
  4. [code=java] public InputStream o2i(ZipOutputStream o);//你能帮我实现这个方法么? [/code] 点赞 写回答; 关注问题 收藏 分享. 邀请回答 5条回答 默认 最新. rednaxelafx 2009-03-19 11:06. 已采纳 不行,要在创建那个ZipOutputStream的时候就以PipedOutputStream为底层stream,而不能等到已经创建出ZipOutputStream实例后再想办法。 就我.

Java IO操作——掌握压缩流的使用(ZipOutputStream、ZipFile、ZipInputStream

  1. Java Mapping - Base64 Decryption and Unzipping Code Description: The below code reads the inputstream decrypts then unzips and writes it to output stream. Also it sets Dynamic fileName using ZipEntry.So enable ASMA in the receiver FileChannel in XI. Java Mapping - Base64 Decryption and Unzipping Cod
  2. Байтовые: java.io.InputStream, java.io.OutputStream; Символьные: java.io.Reader, java.io.Writer; 3. Что общего и чем отличаются следующие потоки: InputStream, OutputStream, Reader, Writer? Базовый класс InputStream представляет классы, которые получают данные из различных ис
  3. in this article, we discuss how to stream data with Spring Boot's RESTful Web Service using StreamResponseBody for highly-concurrent applications
  4. java.util.zip.ZipOutputStream java code examples Tabnin . Zip4j example. srikanth-lingala/zip4j: A Java library for zip files and streams, Passing in new ZipParameters() , as in the above example, will make Zip4j use default zip parameters. Please look at ZipParameters to see the default The following examples show how to use net.lingala.zip4j.core.ZipFile.These examples are extracted from.

ZipInputStream (Java Platform SE 8

  1. 解凍 - java zipoutputstream. InputStreamを使ってZIPからファイルを読み込むには? (2) SFTPを使用してZIPアーカイブからファイルコンテンツを取得する必要があります(ファイル名は1つのみです)。. 私が持っている唯一のものは、ZIPの InputStream です。. ほとんどの例は.
  2. Java as a language provides lot of packages to work with data compression and decompression. The main utility package is java.util.zip, which is used to compress zip compatible files. These packages provide different classes to read, write. create, modify GZIP and ZIP file formats. They also have checksums to validate the size before and after compression. Different Java utilities related to.
  3. Reading a file in Java is pretty simple, we simply can use FileInputStream to read the contents of a file, but if you want to do some operations on the content which is read such as validation, pattern matching, etc, then it would be easier to perform on the String rather than the InputStream.In this article, we will see the different ways to convert InputStream to String in Java
  4. 回答 2 已采纳 response.getOutputStream () 这个不能多次调用,你代码执行应该会报错的. ZipOutputStream压缩 文件名乱码问题. 2017-06-15 01:47. weixin_33985507的博客 使用这个解决压缩的内部文件名乱码问题,使用缓冲流解决压缩的文件内容乱码问题。. /** * 压缩单个文件.
  5. package zip;import java.io.File;import java.io.FileInputStream;import&
  6. Hey, also ich bin erst seit kurzem unter den Java Programmierern und hau deswegen oft Fehler in den Code :D. Und das was ich jetzt machen möchte funktioniert nicht so wie ich es gern hätte. Also dann fang ich mal an. Ich möchte eine Word-datei bearbeiten, also gibt es einen Ordner in dem ein..
  7. home > topics > java > questions > what is stream.. input or output what is the difference Is an inputStream is a tool for reading the data.. or inputStream is a thing that contains the data to read ? Thanks, P.Jerald It's an object from which you can read bytes; that's all you need to know. Sources such as files or sockets or strings or whatever can give you an InputStream so that you can.