By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,677 Members | 1,069 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,677 IT Pros & Developers. It's quick & easy.

InputStream or RandomAccessFile.

100+
P: 281
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 RandomAccessFile?
So what is InputStream here mean?
Mar 1 '07 #1
Share this Question
Share on Google+
3 Replies


10K+
P: 13,264
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 RandomAccessFile?
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

100+
P: 281
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

10K+
P: 13,264
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

Post your reply

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