Are inputstream and outputstream independent of eachother ?

<b><u>Code snippet 1) </u></b><br>
ByteArrayInputStream inputPDFStream = (ByteArrayInputStream) <SOME INPUT STREAM OBJECT>;<br>
byte [] bArray = new byte [inputPDFStream.available()];<br>
//Reading into byte array.<br>
inputPDFStream.read( bArray );<br>
//Dumping byte array contents onto file system.<br>
File file = new File("//exchange//EPP//template//test_PDF_OnPortal.pdf");<br>
FileOutputStream os = new FileOutputStream(file);<br>
os.write(bArray);<br>
os.flush();<br>
os.close();<br>
//Closing input stream, after all operations have been performed.<br>
<b>inputPDFStream.close();</b><br>
<br>
<b><u>Code snippet 2)</u></b><br>
ByteArrayInputStream inputPDFStream = (ByteArrayInputStream)pdfObject.createPDF();<br>
byte [] bArray = new byte [inputPDFStream.available()];<br>
int iBytesRead = inputPDFStream.read( bArray );<br>
/*************** change starts here ************/<br>
//Closing input stream immediately after it has been read from.<br>
<b>inputPDFStream.close();</b><br>
/*************** change ends here ************/<br>
File file = new File("//exchange//EPP//template//test_PDF_OnPortal.pdf");<br>
FileOutputStream os = new FileOutputStream(file);<br>
os.write(bArray);<br>
os.flush();<br>
os.close();<br>
/*************** change starts here ************/<br>
// commented this line of code and shifted it above.<br>
<b>//inputPDFStream.close(); </b><br>
/*************** change ends here ************/<br>
<br><br>               
<b><u>Questions -</u></b> <br>
<br>
1) Are inputstream and outputstream objects totally independent of eachother ?<br>
2) Will the change in the position of the "inputstream.close()" method as shown above, affect the writing of the file to the file system ?
In other words, will the outcome of an "FileOutputStream.write(), flush() or close()" depend on when the inputstream object is closed as seen in code snippet (2) ?<br>
3) Assuming that the output buffer is flushed, will any data that you try to write using the OutputStream.write() method, be written to the outputstream target (whether a file, or response object), irrespective of whether the inputstream is active at that point of time ??<br>
<br>
Thanks,<br>
Navneet.<br>
Changes made by -

Hey kaj...Do you have any idea about the "not normal"
situations in which case the input and output streams
might influence eachother ? ;)Those cases are when both streams comes from a resource which closes both streams when one of them is closed. It's very rare to see, but I've seen some socket implementations which does that.
Kaj

Similar Messages

  • [RS232] how to use InputStream and OutputStream

    hi
    i am using javax.comm
    i get input and outputstream
                  try {
                   out  = serialPort.getOutputStream();
                            in    =serialPort.getInputStream();
                  } catch (IOException e) {
                        }but i can use only write(bytes[]) and read(bytes[])
    i would use println and readln .. how can i do that?
    thanks in advance, nik

    @OP: Maybe this thread is of use to you:
    http://forum.java.sun.com/thread.jspa?forumID=31&threadID=698876

  • Converting string into inputstream and outputstream Jsch (ssh connection)

    hi,
    I'm not really sure if this is the place where i should ask this, but if it is so then tell me!
    So my problem is that everything works just fine with input output streams like in this code, but i need to change this input stream into string messadge(Which would work!!)
    The main problem is not that i can't change string to inputstream, but that when i use inputstream every commands works, and when i try to do the same with sting>inputstream this doesn't work...
    unfortunatelly newgrp server; or newgrp doesn't rerally work just frezzes :/
    anyway i solved the initial problem, because Jsch have two (probably more methods of sending info to unix server, but because there is no documentation htere no way to know :D)
    methods of sending info to server : exec and shell , the exec sends one command and only works with commands like date;ls... now the shell can easily send any type of command including newgrp server1, and everything works :)
    so we connect to the server(passw,user,host) then excecute commands, this code works perfectle but the commented code// doesn't work :
    JSch jsch=new JSch();
    String host=null;
    String user="me1234";
    host="super.server.co.uk";
    String passw="12345";
    Session session=jsch.getSession(user, host, 22);
    session.setPassword(passw);
    session.setConfig("StrictHostKeyChecking", "no");
    session.connect();
    Channel channel=session.openChannel("shell"); //the power of shell, if i use exec doesn't excecute newgrp...
    //String command = "newgrp xxxx;"; //this doesn't work ...
    //InputStream is = new ByteArrayInputStream(command.getBytes("UTF-8"));
    //channel.setInputStream(is);
    //then somehow printout the response from server...
    channel.setInputStream(System.in); // well instead of this I'd prefer channel.send(command);
    channel.setOutputStream(System.out);
    channel.connect();
    Edited by: 842778 on 14-Mar-2011 01:42

    You seem to be leaving out the newlines.

  • InputStream and OutputStream - Already opened for input

    URL url = new URL("website.com");
            URLConnection urlc = url.openConnection();
            urlc.setDoOutput(true);
            urlc.setDoInput(true);
            urlc.setUseCaches(false);
    // read something from a file
            BufferedReader reader = new BufferedReader(new InputStreamReader(urlc.getInputStream()));
            while (reader.read() > 0) {
                // do something
            reader.close();
    // write something to the same file
            DataOutputStream dos = new DataOutputStream(urlc.getOutputStream());
            dos.writeBytes("write something");
            dos.close();"java.io.IOException: Already opened for input:"
    what is that supposed to mean? Doesn't "reader.close();" take care of that?
    I can read the file and I can write to a file. But I can't do both one after another...
    Why is that?

    I just swapped the code
    URL url = new URL("website.com");
            URLConnection urlc = url.openConnection();
            urlc.setDoOutput(true);
            urlc.setDoInput(true);
            urlc.setUseCaches(false);
    // write something to the same file
            DataOutputStream dos = new DataOutputStream(urlc.getOutputStream());
            dos.writeBytes("write something");
            dos.close();
    // read something from a file
            BufferedReader reader = new BufferedReader(new InputStreamReader(urlc.getInputStream()));
            while (reader.read() > 0) {
                // do something
            reader.close();

  • Is it necessary for a BO Consultant to have knowledge on BI as a BI consultant does. Are BI and BO both independent platforms. What kind of BI knowledge is required to develop BO dashboards

    Is it necessary for a BO Consultant to have knowledge on BI as a BI consultant does.? Are BI and BO both independent platforms.? What kind of BI knowledge is required to develop BO dashboards ?

    This is purely Depend on Company Environment .
    1.develop the BI reports using the 'Query Designer' : BI Consultant Responsibility.
    2.or will it be prepared by the BI consultant separately. : BI Bex queries can be designed by BI Consultant's only.
    3. if prepared by the BI consultant then upto what extent BO consultant should have knowledge in BI   :  Need to understand first difference b/w BI Reporting naming convention & BO Naming convention's ,
       Need to  understand complexity of the report , Need to check some reporting functionalities won't support in BO what ever created in BEX
    Kindly refer below doc's : Provides detail explanation   From BI to BO all Possibilities  .
    Points to be considered while integrating BW Bex queries with BO Webi
    Tips & Tricks on developing smart Web intelligence reports over SAP BW Bex Query
    Mapping BEx Query Elements to the SAP BusinessObjects BI 4 Query Panel
    4. or BO and BI consultants need to talk with each other everyday basis  : Depends on Complexity of the Reports.
    5.Is it necessary for BO consultant to have all credential access( for BI Development in SAP Easy          Access Menu) of what the BI consultants have and do it. : Not mandatory
    6. are BI and BO consultants interdependent on each other if source is SAP BI for dashboards : Sometimes if requirement is complex (BO & BI data doesn't  matches ,then sometimes customer exit variables might create in BI not able to replicate , some times complex calculation created in BI Using some  bex query Function's)
    Regards,
    Seshu.P

  • Client dependent and client independent in ALE

    I am going through pdf learning of an ALE scenario,i couldnot get wat is meant by client Independent and client dependent.
    How can i conclude
    Create message type (WE81){color:green} Client independent {color}
    To create a new message type, follow these next few steps:
    u2022 Enter transaction WE81 (ALE -> Extensions -> IDoc types -> Maintain message type for intermed. Structure -> Create logical message type)
    u2022 Choose Create logical message type by double clicking on it
    u2022 Click on change icon to enter change mode
    u2022 Click on New entries to add a new type
    u2022 Enter the required message type, in our case it is ZINVRV and an appropriate description
    u2022 Save and exit.
    Your message type has now been created. The next step will be to link it to the IDoc.
    2.2.1. Link message to IDoc type (WE82 & BD69) {color:green} Client independent {color}
    To link the message type to the IDoc type follow these next few steps:
    u2022 Enter transaction WE82 (ALE -> Extensions -> IDoc types -> Maintain message type for intermed. Structure -> EDI: Message Types and Assignment to IDoc Types)
    u2022 Click on change icon to enter change mode
    u2022 Click on New entries to create the link
    u2022 Enter the message type ZINVRV and the BasicIDoc type as ZINVRV01
    u2022 Save and exit
    u2022 Enter transaction BD69 (ALE -> Extensions -> IDoc types -> Maintain message type for intermed. Structure -> Assign message type to IDoc for ALE)
    u2022 Click on change icon to enter change mode
    u2022 Click on New entries to create the link
    u2022 Enter the message type ZINVRV and the BasicIDoc type as ZINVRV01
    u2022 Save and exit
    Your IDoc is now linked to your message type. We still need to link object types and add the message to the model before we can use the message.
    2.2.2. Maintain object type for message type (BD59) Client independent
    The ALE objects are used to create links between IDocs and applications objects, to control the serialisation, to filter messages in the customer model and to use listings.
    For our own message type and IDoc you must maintain object types for the links.
    If you want to check the serialisation for the message type, then you must maintain object types for the serialisation. If no serialisation object has been maintained for a given message type, then the serialisation will not be checked for this message type.
    To add an object type to our message type, follow these next few steps:
    u2022 Enter transaction BD59 (ALE -> Extensions -> ALE object maintenance -> Maintain object types)
    DOC NAME: ALE_SCENARIO_DEVELOPMENT_PROCEDURE
    Version 1 Page 6 of 16
    ALE Scenario Development Guide
    u2022 Type in your message type ZINVRV and press enter
    u2022 Click on New entries
    u2022 Enter your object type, LIFNR (We need to use the vendor as a filter object), the segment name where LIFNR resides, Z1INVRV, a number 1 for the sequence followed by the actual field name LIFNR
    u2022 Save and exit.
    You have now created an object that weu2019ll use as a filter object in the customer model to direct the flow of messages to the various logical systems based on the vendors in the filter of the message type ZINVRV.
    We now need to add our new message type to the distribution model.
    2.3. Configuring the Distribution Model
    This task is performed on your ALE reference client.
    2.3.1. Manual Configuration (BD64) {color:green}  Client dependent {color}
    To manually configure the customer distribution model, read the ALE configuration procedure, and follow these steps:
    u2022 Perform the Maintain customer distribution model directly function. (ALE -> Distribution customer model -> Maintain customer distribution model directly)
    u2022 Specify the customer model you want to maintain and the logical system that is to be the sender of the messages OR create a new model. (Create model ALE with logical system ALELS1C400)
    u2022 Choose the receiving systems to which the sending system must forward message type ZINVRV to.
    u2022 For each receiving logical system allocate the message type necessary for communication to the receiving systems as per ALE configuration procedure.
    u2022 Create filter objects (in our case LIFNR as the object type with the associated vendor number, 0000018001 with leading zeros, in the object area) for the message types.
    u2022 Save the entries.
    Refer my query within color:green
    Edited by: aditya  sharma on Jul 14, 2010 12:57 PM
    Edited by: aditya  sharma on Jul 14, 2010 1:01 PM

    A client is an independent business unit within an R/3 System, Data in the R/3 are classified as cleint-Dependent and client-independent.
    Client-independent data such as ABAP Programs, R/3 repository objects throught the entire system. Other data is client-dependent. meaning, it can be viewed from one client. Cleint-dependent data includes customizing application and user data.
    Eg.
    Scripts are client dependent, means the changes done to SAP scripts in particular client will not be reflected in other client.
    Smartforms are client independent, means changes done in one client will be reflected in all the clients.
    Server : ECC6
    Client : 100 , 200 , 300 , 400
    Now suppose you have developed report in DV server client 100.
    Then you will be able to see that in all clients.
    Hence this is called as client independent. You can change anywhere and changes will be reflected to all ...
    Now suppose you have developed a script in DV client 100.
    You will not be able to see that in client 200 or 300 or 400 unless ytou copy that from client since it is client dependent.

  • Where are Answers and Dashboards stored?

    If we deliver answers and dashboards to customers and they customize it further, how can they upgrade to next release's dashboard and answers?
    I want to know where are dashboards and answers stored so that we can provide an upgrade script.
    Edited by: user732932 on Nov 17, 2009 10:58 AM

    Hi User,
    If a user creates queries and dashboards they are stored in the Catalog, this is in the OracleBIData>Web>Catalog folder. If you drill down into thsi folder you eventually come to the individual xml files.
    The repository, (.rpd) is in the OraceBI>Server>Repository folder, the two can be maintained independantly. If your customer wants new data sources or tables adding to their RPD, you can merge these changes using the Admin tool, any changes here will not affect existing content in the dashboards, as long as the existing presentation layer is not altered. Assuming they do not maintain the rpd themselves, they could just send you an existing one for you to edit then replace theirs?
    What it sounds liek you are saying though, is that they will have added queries and dashboards to the web catalog, and that you will then add more queries and dashboard pages to a development catalog, in this case it's very easy to copy and paste new files from one catalog to the other using the catalog manager. Ther is no need to touch the actual xml. NEVER copy a new catalog over an existing catalog, if you are replacing the whole catalog, back it up then delete it from the Catalog folder and paste in the new one.
    If you are upgrading the version of OBIEE, none of these items should be affected, make sure you back-up first.
    I hope this clears it up.
    Regards
    Ed

  • Where are SmartView BI+ Content Independent Provider Log Files

    We are on Oracle/Hyperion v11.1.1.3 (BI/Foundation/Planning Services on Solaris Unix; Weblogic; Essbase on Windows).
    Our users have created some MS Powepoint presentations that contain pages that run a Financial Report (FR) which queries data from a planning application using a "Hyperion Reporting and Analysis" Independent provider connection (example: "http://server_name:19000/workspace/browse/listxml").
    I am unable to find the location of the log files that shows where logon/activity is tracked. We have looked and only find tracing information from Essbase log files when the query runs and authentication happens at the Essbase level but need to find where the other log information (including APS service activity) is logged to.
    Thanks.

    Hello Ramkumar,
    Go through the link https://help.sap.com/saphelp_nw73/helpdata/en/21/e77dc01e694f4f89ad6a833420c7d5/content.htm?frameset=/en/6a/f247bf0ce745…
    for more information..
    Regards
    Subbarao M

  • BOE XIR2 SP5 All processing servers are down and not starting up

    Hi Guys,
    My all processing servers are down and not starting up I restarted all the service by ccm.sh
    I killed all the servives manually and started again
    Still  only processing servers go down  any clue guys I  really stucked here
    I cheked logs I got one failed message that is socket failed.
    And some strange message
    Webi report server: no need to read repositry path:.................
    Did any one face this issue before.....
    I know you guys help me on this ....................................

    Hello,
    is these product independent ? Are only DeskI Servers disabled or all like WebI and Crystal too ?
    Regards
    -Seb.

  • Activity dependant planning and Activity independent planning

    Hello gurus,
                     Can anyone please explain the difference between the Activity Dependant Planning and Activity Independant Planning with some examples
    thanks
    rihana
    Please, search Web

    Hi Rihana,
    Activity indipendent planning : Activity-independent cost planning covers both primary and secondary costs, but does not refer to a specific activity type.  Eg : internal and external distribution
    Activity-dependent planning : Activity-dependent planning of primary and secondary costs, on the other hand, enables you to plan both fixed and variable costs. You may require this functionality if your costing system uses flexible standard costing based on marginal costs. In this release you can carry out flexible standard costing based on full costs.
    This means fixed costs are used to calculate the cost rates and are in effect converted to variable costs.
    Regards,
    Shivalli

  • SALES ORDER AND CUSTOMER INDEPENDENT REQUIREMENT

    What is the difference between sales order and customer independent requirement?
    Where these are used?

    Hi Sachin,
    If you get an order from your customer you create a sales order in your system. Refering to this SO you can create (e.g.) delivery document and issue your goods from your stock.
    In case of PIR (planned independent requirements) you don't know who your customer is. You can use these requirements e.g. for forecasts, MTS environment.
    In MTO environment SO will generate PrdOrd, and after the confirmation your goods will get to SO-special stocks from where you can ship them out. You won't produce in this environment independently from SO.
    In MTS environmnet you can use both SO and PIR. E.g. in case of planning startegy 11 MRP doesn't calculate with your SO, only PIRs are considered. This strategy is very simple: you input your production plan as PIRs. These PIRs will generate PldOrd, then production orders will be issued and after confirmation your PIRs will disappear. It doesn't matter how many SOs you have, it doen't matter how high your stock levels are...MRP displays them only for information purpose.
    In strategy 40 (MTS) both PIRs and SOs (and stock levels) are considered, and (one) purpose of PIRs is to level your production (you will produce even thiough your slaes figure are low > later you can fulfill high demands from stock and you won't have to increase your production quantities). SOs will consume PIRs based on the rules you define.
    Please check this link:
    http://help.sap.com/saphelp_46c/helpdata/en/60/9ea1536fbd11d191820000e8a5f6e6/frameset.htm
    BR
    Csaba

  • 1. Is your service multi-tenant? Can an enterprise manage their users and data independent of other enterprises using their service   or is your service more like a consumer service Do you support any sort of enterprise identity? If so, do you support SAM

    1. Is your service multi-tenant? Can an enterprise manage their users and data independent of other enterprises using their service is your service more like a consumer service ?
    2. Do you support any sort of enterprise identity? If so, do you support SAML, openID or user provisioning APIs?
    3. What level of audit logging do you perform? All read/write of data? Do you support ability for customers to view only their activity logs?
    4. What level of penetration testing do you perform? Is it done by 3rd parties? How often are these tests performed?

    1. Is your service multi-tenant? Can an enterprise manage their users and data independent of other enterprises using their service is your service more like a consumer service ?
    2. Do you support any sort of enterprise identity? If so, do you support SAML, openID or user provisioning APIs?
    3. What level of audit logging do you perform? All read/write of data? Do you support ability for customers to view only their activity logs?
    4. What level of penetration testing do you perform? Is it done by 3rd parties? How often are these tests performed?

  • Inputstream -- Parse -- Outputstream

    Hi guyz,
    Just need a little help.
    What I want is:
    1) Receive data via InputStream
    2) Parse the data contained in InputStream
    3) If parsing was succesful, I wan't to write content of InputStream to OutputStream.
    The above procedure is a requirement.
    Now, all the parsing stuff I got covered. I'm just not sure of how to write the content of my InputStream in to the OutputStream since the InputStream seems unavailable after parsing - I get a 'java.io.IOException: Bad file descriptor' whenever I try to read the InputStream again after parsing.
    Hope someone can throw a few hints my way:-)
    Thanks in advance.
    Daniel

    If you know the InputStream is associated with a file, I suppose you can reset it to the beginning of the file somehow; if only by closing and re-opening the file.
    If the stream may be associated with a socket or something else, the above approach won't work (I think). If it's acceptable to write the data to the output stream along the way as you read it for parsing, do that. Otherwise, keep it in a variable (like a byte array, for instance) and write it out in the end.
    Does this help?

  • Difference between PrintWriter and OutputStream

    Hi,
    What is the difference between the following snippets?
    PrintWriter out = response.getWriter();
    out.write(arguments);
    and
    OutputStream os = response.getOutputStream();
    os.write(arguments);
    Regards,
    Kashif

    Writers are generally used for characters/strings and output streams for byte arrays or bytes. The "root" is OutputStream. Everything else chains to that in one way or another.
    - Saish

  • Difference between client dependent table and client independent table

    hi all,
                  i m new in sap pls tell me the difference between client dependent table and client independent table.
    tell me in detail.
    thanks and regards
      vikas saini

    HI
    Client dependent Means if you create that data in one client is limited to that client only and it is not accessable in other clients
    Like SAP SCRIPTS and STD texts data
    where as Client Independent means the data if you create in one client that is available in that as well as in other clients
    Like SMARTFORMS, All dictionary Objects data and Repository objects data like Programs, Fun modules, tables etc..
    There is no specific reason behind why scripts are client dep[endent and smartforms are client independent!!!
    As for SAP -- Scripts are called client dependent because if you create client in say,200 it would be available in that only.If you want to test the script in client 300 then it won't be there,you will have to go to transaction se71 in 300 .Then Utilities-> Copy from client.Give the source as 200 & form name(i.e. script name) & copy.
    Few more reasons why....? Please read below:
    SAPscript technology is based on a mainframe product from the 1980s.SAPscript forms have always been -- under the hood -- relatively passive objects, with minimal embedded logic. These forms were designed to be driven and controlled by ABAP programs, much in the way ABAP programs read in database tables to produce reports;
    if you ever download a SAPscript form (e.g., via utility program RSTXSCRP), and look at the portable text file it produces you'll see what I mean.
    Many text objects (e.g., invoice header texts) are bound directly to documents which are client-dependent, so it makes sense for these text objects to also be client-dependent. From a complexity standpoint, SAPscript forms are close enough to these text objects where I can see how it made sense at the time to make them client-dependent too.
    What is client dependent and Client Independent
    https://www.sdn.sap.com/irj/sdn/forums

Maybe you are looking for

  • Sales order creation with bapi in webdynpro using table control

    When i use table control to update the line items only first row is getting updated in the sale order creation and the loop is not updating the other row to header only the first row is getting saved, for the same set of data sale order is getting cr

  • How do i install microsoft office home and student 2010?

    i need help installing 2010 microsoftoffice on my macbook air

  • Error when downloading iTunes. itunes.msi?

    I have been trying to update iTunes 8 to iTunes 9, but I am recieving the following message: "The Feature you are trying to use is on a Network resource that is unavailable. Try using an alternate path to the folder containing the iTunes.msi file." C

  • KQ304 Error message in oktz

    Dear experts, When I customized in transaction oktz, I created a new cost component for a cost component structure. But when i save it, there was an error message: "Maximum number of cost fields reached (40). The maximum number of cost fields defined

  • Laserjet 3330 error message 79

    After a power interruption I have an error message 79 and do not know how to clear this.  The printer will do nothing until I can clear this.  Can anyone help me?  Thanks. Fletch111