473,545 Members | 2,715 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

InputStream or RandomAccessFil e.

281 Contributor
I have downloaded one image program and about to understand it.
This is from its documentation:
Expand|Select|Wrap|Line Numbers
  1. * image.setInput(in); // in can be InputStream or RandomAccessFile  
I run the java class from prompt: java Image me.jpg
My Q:
1. Am I right by saying that 'me.jpg' is as RandomAccessFil e?
So what is InputStream here mean?
Mar 1 '07 #1
3 5367
r035198x
13,262 MVP
I have downloaded one image program and about to understand it.
This is from its documentation:
Expand|Select|Wrap|Line Numbers
  1. * image.setInput(in); // in can be InputStream or RandomAccessFile 
I run the java class from prompt: java Image me.jpg
My Q:
1. Am I right by saying that 'me.jpg' is as RandomAccessFil e?
So what is InputStream here mean?
No me.jpg is the file name If you look before that line you will find where the InputStream or RandomAcces file was created.

The variable "in" is the InputStream or RandomAcces
Mar 1 '07 #2
shana07
281 Contributor
No me.jpg is the file name If you look before that line you will find where the InputStream or RandomAcces file was created.

The variable "in" is the InputStream or RandomAcces
From this method, I think it's InputStream isn't?
really appreciate if you could teach/give example on how to use InputStream as input.
Expand|Select|Wrap|Line Numbers
  1. private static void run(String srcName, InputStream in, Image image, boolean verbose) 
  2.  {
  3.      image.setInput(in);
  4.                ......
  5.  
  6.  
Mar 1 '07 #3
r035198x
13,262 MVP
From this method, I think it's InputStream isn't?
really appreciate if you could teach/give example on how to use InputStream as input.
Expand|Select|Wrap|Line Numbers
  1. private static void run(String srcName, InputStream in, Image image, boolean verbose) 
  2. {
  3.     image.setInput(in);
  4. ......
  5.  
  6.  
Yes it's InputStream. You already have an example on how it's being used there. Just go through it and understand it.
Mar 1 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
8522
by: Seong Jin, Cho | last post by:
Hi. Is there a way to get an unbuffered InputStream from Process? I found out that java.lang.Win32Process and java.lang.UNIXProcess both wraps the stdout with java.io.BufferedInputStream, but I need an unbuffered one.
1
2106
by: Charles.Deisler | last post by:
XmlTextReader requestdata = new XmlTextReader(Request.InputStream); XmlTextWriter xmltextwriter = new XmlTextWriter(somefile,someencoding); XmlTextWriter xmltextwriter2 = new XmlTextWriter(somefile2,someencoding); xmltextwriter.WriteNode(requestdata, false); // i want to write to another writer here by resetting the reader ...
0
2194
by: bvasanth123 | last post by:
Hi, I would like to know how can I read an InputStream into Excel object. In my web app, user uploads MS-Excel file though asp.net html file control. I get UploadedFile.PostedFile.InputStream() where UploadedFile is the name of file control. Not I have InputStream. How can I read into Excel object for parsing as excel file. Regards, Vasanth
0
1610
by: bvasanth123 | last post by:
Hi, I would like to know how can I read an InputStream into Excel object. In my web app, user uploads MS-Excel file though asp.net html file control. I get UploadedFile.PostedFile.InputStream() where UploadedFile is the name of file control. Not I have InputStream. How can I read into Excel object for parsing as excel file. (Language VB.NET)...
1
8076
by: samtilden | last post by:
I want to print out some tracing messages from Global.asax.cs/Application_BeginRequest(). I easily got: System.Web.HttpContext.Current.Request.RawUrl, and System.Web.HttpContext.Current.Request.Params. I would now like to get the entire:
1
4571
by: O.B. | last post by:
I have the need to read a file (version.txt) that is embedded within an WAR file that is within an EAR file: foo.ear contains bar.war contains resources/version.txt I am able to get the bar.ear file as an inputstream as follows: import java.util.zip.ZipEntry; import java.util.zip.ZipFile; ZipFile zipFile = new ZipFile("foo.ear");
2
5704
by: jyohere | last post by:
I want to know which one will be faster randomAccessFile or Bufferedeader. I am reading a file about 18 MB. For that using randomAccessFile i will read from the beginning of the file the first time and i will get the position of file pointer depending on the line's data and after that i will start reading from the position of file pointer. this...
0
1605
by: irkahs | last post by:
Hey all, Need some Java help here. This is a code fragment that does a few things. 1) Allows adding to a RAF file. 2) Searches for a match and displays related records. and
7
11053
dmjpro
by: dmjpro | last post by:
Hi All .... I am trying to edit a file using RandomAccessFile. I am having a little bit problem. My file is ... i m debasis jana.
0
7499
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7432
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7689
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7786
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6022
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3490
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1919
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
743
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.