1. Input and Output Stream Pipe in Java stackoverflow.comDoes anyone have any good suggestions for creating a Pipe object in Java which is both an InputStream and and OutputStream since Java does not have multiple inheritance and both of ... |
2. printf() functionality in Java combined with a CharBuffer or something like it stackoverflow.comI am a little confused here. I would like to do something like this:
|
3. how to use a ByteBuffer with an OutputStream stackoverflow.comI need to put the contents of a java.nio.ByteBuffer into an java.io.OutputStream. (wish I had a Channel instead but I don't) What's the best way to do this? edit: and I can't ... |
4. Java writeObject Vs. writeUTF stackoverflow.comWhat is faster? |
5. Java reading standard output from an external program using inputstream stackoverflow.comI am trying to develop a class that reads the standard output of an external program(using an instance of Process, Runtime.getRuntime().exec(cmdLine, env, dir)). The program takes user inputs during the process, and ... |
6. Formatting a double output using BufferedWriter in Java stackoverflow.comI'm working on an assignment, and have completed the code, however I am having an issue with correct formatting of the output. I am taking a text file, separating the ... |
7. What is InputStream & Output Stream? Why do we use them and when do we use each of them? stackoverflow.comIt sounds like a very silly question but can anyone explain me about Input stream and output stream. I remain confused about when do we need input stream and when we need ... |
8. platform-independent /dev/null output sink for Java stackoverflow.comOther than an anonymous class ( |
9. output as part of input stream stackoverflow.comIs there a way to output some text and allow a user to edit and submit as System.in? Obviously System.out.print is not editable... Eg. system outputs:
user edits to:
system echos:
|
10. Streaming output with commons-exec? stackoverflow.comCan anyone give me an example of how to stream the output of an external program executed with |
11. Java's [Input|Output]Streams' one-method-call-for-each-byte: a performance problem? stackoverflow.com[Input|Output]Streams exist since JDK1.0, while their character-counterparts Readers|Writers exist since JDK1.1. Most concepts seem similar, with one exception: the base classes of streams declare an abstract method which processes one single byte ... |
12. Write string to output stream stackoverflow.comI have several output listeners implementing OutputStream. It can be PrintStream writing to stdout or to a File, it can be writing to memory or any other output destination therefore I specified ... |
13. Java Process getInputStream vs. getOutputStream stackoverflow.comI'm a bit confused about the streams... which is which? Simply, which stream should I use to catch the output of my Process, and which stream should I use to give my ... |
14. "Turn off" the output stream stackoverflow.comI'm using a wayward library that, unfortunately, prints information to |
15. How to write to Standard Output using BufferedWriter stackoverflow.comI am currently writing an application that produces several log files using BufferedWriter. While debugging, however, I want to write to System.out instead of a file. I figured I ... |
16. The difference between DataLine and (Output|Input)Stream? stackoverflow.comI am working on sound processing with the use of Java now. Within my project, I have to deal with the stream. So I have a lot of staffs to do ... |
17. Resetting Standard output Stream stackoverflow.comI know that there is a function in Java to set Standard Output Stream to any user defined value using |
18. Java Input and Output stackoverflow.comExplain the difference between the outputs of the following two fragments of code for outputting an int i to a file: i)
ii)
I ... |
19. reading from DataInputStream without knowing the output type stackoverflow.comSay i'm using |
20. Java output from process buider overwritten when using BufferedReader stackoverflow.comI'm trying to run an external program in Java and to read the output. The program is a Linux application in C++ that runs a data mining algorithm and prints the ... |
21. java - PrintWriter with FileWriter and BufferedWriter stackoverflow.comI'm at my wits end here. I'm trying to print a few thousands of lines in a file, using the following:
|
22. How do you mock an output stream? stackoverflow.comBy 'output steam' i mean any object which receives a sequence of bytes, or characters or whatever. So, java.io.OutputStream, but also java.io.Writer, javax.xml.stream.XMLStreamWriter's writeCharacters method, and so on. I'm writing mock-based tests ... |
23. Trouble getting standard output in Java from a C program with getchar() stackoverflow.comI'm trying to call a C program from Java and capture the standard output. Here is my code:
|
24. Output control for HDMI out during live streaming in Java stackoverflow.comI am working on Android apps. I have to block HDMI Output during Live streaming when the device is connected to a non-HDCP compliant device. I have no idea how to find ... |
25. Read a single file with multiple BufferedReaders stackoverflow.comI'm working on a program that needs to update a line that depends its value on the result of a line that goes read after. I thought that I could use ... |
26. Accessing program messages output to error stream stackoverflow.comI've created a class which processes files and if it encounters certain specific errors, it outputs relevant error messages to the error stream. I am working on another class that needs ... |
27. Output Stream in java stackoverflow.comPlease explain out variable in System.out out is sometimes referred to be object of type OutputStream sometimes referred to as object of type PrintStreamand even when it is ... |
28. Way to close specific output streams stackoverflow.comDo you think this code close correctly the output stream entry ? Knowing that this is not the same type of output stream.
|
29. UTF-8 output of java program differs if compiled on command line vs. in IntelliJ stackoverflow.comThe output of the following program differs depending on whether I have IntelliJ compile it, or whether I compile it by hand from the command line. As far as I ... |
30. Stream writer on char[] does not work stackoverflow.comI have the following code, but the char[] cc does not seem to get written when I checked the output file. Can someone tell me what's wrong?
|
31. java input output stream stackoverflow.comDoes anyone have any good suggestions for creating a Pipe object in Java which is both an InputStream and and OutputStream since Java does not have multiple inheritance and both of ... |
32. why can't see the output in dos window after using buffered reader..?? coderanch.comI've a simple program which runs the Dos "dir" command through java. I can See the output in my java text area but when i run this program on the dos prompt it doesn't show anythin and i have to Cntrl-Alt-Del the programe. My code isimport java.io.*; public class toyshell2{ public static void main(String args[]) { try{ toyshell2 toy = new ... |
33. return or output stream? coderanch.comi'm trying to find a way to return a string from 'streamgrabber'. without the return, it works fine and prints out the string returned from 'hashit.pl' which is a perl script/program (i'm always confused about the difference). why can't i return a variable? do i need to return a buffered output stream? what's the best way? all help is appreciated. [still ... |
34. stream output to reader input? coderanch.comIOers, I am correct in stating that a Reader reads 1 byte at a time? I tought it read by default 1 unicode (16 bit) char at a time. I wrote the following very simple test program to write (using a stream) a byte followed by 3 chars. When I read these using a reader it seems to read one byte ... |
35. Output stream: int read() AND write(int)! Why int? coderanch.comNo, it's a good question, I think. For InputStream there's the fact that we need to be able to return a special value to indicate an end of stream. So all possible byte vaues are mapped to the 0-255 range, and -1 is used to indicate end of stream - meaning we need more than 256 values, and the return type ... |
36. No output written to a file using FileWriter coderanch.comHello: FileWriter fw = new FileWriter("dnslookup.txt"); fw.write("apogent.com"); Can someone explain to me as to why the above 2 lines of codr don't work. What I mean by that is that nothing is written out to the file 'dnslookup.txt'. This is a very simple implmentation of a writer. What is it that I am missing out here in code, why does the ... |
37. how to capture output in stream coderanch.com |
38. Recycling my piped streams for file output? coderanch.comHey, I have a question regarding streams. Ive looked high and low on the net, and havent really solved it via this route so im posting. I have a system whereby I am saving all System.out + System.err messages to a console. This works fine. I.e. piOut = new PipedInputStream(); poOut = new PipedOutputStream(piOut); outputPrintStream = new PrintStream(poOut, true); System.setOut(outputPrintStream); I ... |
39. File Output stream adding extra character while writing coderanch.comHi, Program objective is to make an Xml and save it in File System over a n/w. For that i am using the following lines of code : public boolean xmlToFile(Document document, String pathAndNameWithExtension) { if(pathAndNameWithExtension == null) pathAndNameWithExtension = "file///XMLOutput.xml"; try { File file = new File(pathAndNameWithExtension); file.createNewFile(); TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformar = tFactory.newTransformer(); DOMSource domSource = new ... |
40. Quickie question about DataInput and Output Streams coderanch.comSo, I have a simple client/server program that used to send a String across the open connection using writeUTF and readUTF. So everything was working fine where I could send multiple Strings and then they were printed out on the server side one by one. To my dismay, it turned out that I could not use the writeUTF, and instead am ... |
41. writing process output stream (p.getOutputStream) to a file coderanch.comHi i am calling a java process from my web UI. i am using runtime.exec to execute an external java program. i need to redirect the process output stream to a file. That means all the system.out and system.err should be written to a file. i dont how to redirect the p.getOutputStream() to a file. Here is the code which i ... |
42. closing PrintWriter cuts output coderanch.comimport java.io.*; import java.util.*; public class ClassFinder { public static void main(String[] args) throws IOException { // stuff try { FileOutputStream fos = new FileOutputStream("file.txt", true); try { for (int i = 0; i < files.length; i++) { Process process = Runtime.getRuntime().exec("cmd /c command); InputStream is = process.getInputStream(); StreamEater outputEater = new StreamEater(is, "", fos); outputEater.start(); if (process.waitFor() == 0) { ... |
43. problem in output when using ObjectOutputStream . coderanch.comHi ALL, I have one doubt. Here is My program ----------------------- import java.io.*; class Player { Player() { System.out.print("P"); } } class CardPlayer extends Player implements Serializable { CardPlayer() { System.out.print("C"); } public static void main(String[] args) { CardPlayer c1 = new CardPlayer(); try { FileOutputStream fos = new FileOutputStream("play.txt"); ObjectOutputStream os = new ObjectOutputStream(fos); os.writeObject(c1); os.close(); FileInputStream fis = new ... |
44. Using an output stream to write an int to file coderanch.comI'm trying to create random numbers(which is working fine) but I need to get them to output to a file to be read later on. public static void generate()throws IOException{ BufferedWriter out = new BufferedWriter(new FileWriter("Output.txt")); Random rand = new Random(); int[] AArray = new int[200]; for(int i=0;i<=20;i++){ int r = rand.nextInt(1000); System.out.println(r); AArray[i]=r; } for(int i=0;i<=20;i++){ out.write(AArray[i]); } out.close(); } ... |
45. Gets the output of the ObjectOutputStream in a program coderanch.com |
46. stream output variables to specific positions in output file coderanch.comHello, In a proprietary db editor I put in the following: output stream outstream to value(outfile) append. put stream outstream variable1 format "X(5)" at 1 variable2 format "X(5)" at 10 variable3 format "zz999999" at 20 etc. which allowed me to line up a variable to a position in the file. I cannot find any such similar Java example. I have ended ... |
47. formatting output in printstream coderanch.com |
48. Difference between PrintWriter and Output Stream. coderanch.com |
49. Not getting input or output to the Stream coderanch.comMaking the cliche chat program. Am not getting input or output. Please help. I feel like a complete noob again. package com.lab.week5; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.ServerSocket; import java.net.Socket; import java.util.concurrent.Semaphore; public class ChatServer extends Thread { private static Semaphore socketSemaphore = new Semaphore(1); public ChatServer() { runServer(); } @SuppressWarnings({ "null" }) private void runServer() { ... |
50. Mark the current position in Output Stream coderanch.comThere isn't anything like that in the API. However, you can always write it yourself. Here is one approach - extend FilterOutputStream; that way your class will act as a wrapper around any other OutputStream. - keep a buffer of bytes written to your stream but not to the wrapped OutputStream. - when calling flush() you clear the buffer and write ... |
51. writing printwriter output to file coderanch.comHow to write the printwriter output in the code below to a file.I am new to java. Please help me thanks in advance public void formatTx(DsTransaction tx, DsMetaData dbMeta, PrintWriter out) { out.print("Transaction: " ); out.print("numOps=\'" + tx.getSize() + "\' " ); out.println("ts=\'" + tx.getStartTxTimeAsString() + "\'"); for(DsOperation op: tx.getOperations()) { TableName currTable = op.getTableName(); TableMetaData tMeta = dbMeta.getTableMetaData(currTable); String opType ... |
52. output stream to input stream coderanch.comWell, it depends on requirement. Here is my business case.. I am working with Apache FOP where JAXB annoted java beans are used to generate PDF documents. Here are two steps. 1) JAXB marchaller converts bean to XML output stream. I dont want to write to a file. 2) Above output stream needs to go in as inout to FOP transformer. ... |
53. FileReader Vs FileInputStream and same goes to output java-forums.org |
54. Pausing the output stream? forums.oracle.comAhh! Sorry bout that... stupid friend. Anyway. I have a question. Is there a way to pause the output in a series of System.out.println commands? Like I'm making a game with a friend and its all text based using the java console and... It would be very confusing if all this text popped up at once! Something like... System.out.println("Hello!") //pauses System.out.println("Nice ... |
55. Can I read from an output stream? forums.oracle.comIs that even possible? I have the super class to all byte output streams, um...output stream, is it possible to read from it (not write, that parts working fine), I know this is a little weird and unusaul but, can it be done? Thanks for any help! And no I don't want a byte to character conversion (the byte data will ... |
56. Reading an output Stream forums.oracle.comI changed the strings to be equal to "" and now I get nothing kicked back. If I put perfect information in the text boxes and hit the execute command the command works flawlessly. But if I put something screwy in the text boxes it just stares at me and outputs nothing. If I run the same command from the command ... |
57. NNTP Input stream / File output stream help forums.oracle.comMy original battle was that a BufferedReader and FileWriter caused the downloaded file to fail a crc check. After investigation (comparison to a correctly downloaded file) I found that wherever the correct version had a (int) value of 65533 my downloaded file had a (int) value of 63. I came to the conclusion this has something to do with the default ... |
58. Fileinput and output stream forums.oracle.comahhhh great scott. errr i hate this programming and i love it also i guess drinking beer and programming is a bad idea lol. That was the problem paul i had that print.close() inside the while loop omg how can i do that Thanks alot a bunch paul and no the compiler did not give me any IO exception also. if ... |
59. Java - InputStream - Weird Characters in the Output! forums.oracle.comHi, I have a software which outputs lines of numbers one by one. In another java program, I use BufferedReader as follows: BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream(),"US-ASCII")); where pr is the process which runs the software. For each line in the output stream, I try to check whether the first number in the line is greater than a certain value ... |
60. Cannot read from an Output stream of a process forums.oracle.comI believe that ssh is one of those unix commands that is specifically written to be run only in terminal mode. You're probably better off just getting a java ssh library. Otherwise, I'd suggest the following: 1. Try some other command in the same Java code. If it works, it's an ssh-specific issue. If it fails in the same way, there's ... |
61. altering output file of FileAppender programatically forums.oracle.com |
62. input&output stream forums.oracle.comHi! I've got InputStream and OutputStream (from 2 sockets, but that's not important). And I want to "connect" Input + Output Stream, so when I read something from Input, I will write it to Output one solution can be to use buffer, but i hope, there is some other way... thanks a lot |
63. Input stream to output stream forums.oracle.comWhat????? What is it, exactly, that you want to do? Do you want to write to the file you just read from? If so close the InputStream and open an OutputStream. Other Input to Output scenarios are likely to run analog to this one, so answer the question and maybe you can be helped. |
64. writing printwriter output to file forums.oracle.comHow to write the printwriter output in the code below to a file.I am new to java. Please help me thanks in advance public void formatTx(DsTransaction tx, DsMetaData dbMeta, PrintWriter out) { out.print("Transaction: " ); out.print("numOps=\'" + tx.getSize() + "\' " ); out.println("ts=\'" + tx.getStartTxTimeAsString() + "\'"); for(DsOperation op: tx.getOperations()) { TableName currTable = op.getTableName(); TableMetaData tMeta = dbMeta.getTableMetaData(currTable); String opType ... |