InputStream or RandomAccessFile.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shana07
    Contributor
    • Jan 2007
    • 280

    #1

    InputStream or RandomAccessFile.

    I have downloaded one image program and about to understand it.
    This is from its documentation:
    Code:
    * 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?
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by shana07
    I have downloaded one image program and about to understand it.
    This is from its documentation:
    Code:
    * 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

    Comment

    • shana07
      Contributor
      • Jan 2007
      • 280

      #3
      Originally posted by r035198x
      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.
      Code:
      private static void run(String srcName, InputStream in, Image image, boolean verbose) 
       {
       	image.setInput(in);
                     ......

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by shana07
        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.
        Code:
        private static void run(String srcName, InputStream in, Image image, boolean verbose) 
        {
        	image.setInput(in);
        ......
        Yes it's InputStream. You already have an example on how it's being used there. Just go through it and understand it.

        Comment

        Working...