InputStream 2 « API « Java I/O Q&A





1. InputStream help    coderanch.com

2. Creating InputStream from a String    coderanch.com

3. How to reassign standard input stream?    coderanch.com

Hello, i have a problem where i need to prompt the user to enter data into the console window (1 line) and read from the console. I wrap the System.in in a BufferedReader like this: {... BufferedReader br = new BufferedReader(new InputStreamReader(in)); String inputStr = br.readLine(); while (inputStr != null){ //read from console } Now the problem is that if the ...

4. Cloning inputstream    coderanch.com

5. IReport and InputStream    coderanch.com

Hello Guys! I'm trying make a report with JasperReport, but i doesn't compile the JRXML with "JasperCompileManager.compileReport" My libary "Jasper" don't undestanding may InputStream , because is show at the error: java.lang.reflect.InvocationTargetException . Caused by: java.lang.VerifyError: (class: net/sf/jasperreports/engine/xml/JRXmlDigesterFactory, method: configureDigester signature: (Lorg/apache/commons/digester/Digester V) Incompatible argument to function I think that object InputStram is unformat fot my libary Jasper. This a part ...

6. Instantiating a Java .class file from its InputStream    coderanch.com

Hi, In my web application, I am supposed to allow the user to specify a .class file present on his/her system, and then instantiate it through the web app. The files get uploaded as formFile's and I can get the InputStream from them. However, the problem I'm facing is to convert this InputStream into it's corresponding class object. I tried to ...

7. Adding enter to inputstream    coderanch.com

Well you can't directly. However, you might be able to wrap your InputStream in a custom InputStream. This class which you'll have to write sometimes returns the enter (as bytes), otherwise it returns the value of the wrapped InputStream's read() method. Keep in mind though that a) you also have to take into account the other read methods, and b) how ...

8. Behaviour of InputStream methods during serial transmission.    coderanch.com

It depends on how your hardware works, what sort of InputStream you are using, and possibly on what was happening in the stream when the disconnection occurred. But there are two basic possibilities: (a) it will throw some sort of IOException, or (b) read() will block indefinitely. If you are using a socket with timeout, then it will probably block until ...

9. BufferedReader and InputStream    coderanch.com





10. BufferedReader conflicting with InputStream ?    coderanch.com

Hello all, I am writing a program composed of a server and a client (see code below). The client must send data (byte[]) to the server.. To achieve this, it sends a name (identifying the data), a size (also as String), and finally the data. On client side I create a socket and write the name/size via a PrintWriter and the ...

11. Saving InputStream to File    coderanch.com

12. detecting DTMF in InputStream    coderanch.com

Hi, My application is receiving an InputStream containing audio in PCM 8bits mono 8Khz which, utltimately, comes from a telephone call. Could somedy tell me how to detect DTMF tones inside this audio stream? I had a look at JTAPI, but it looks like it's a spec made of interfaces only and that implementations are vendor-dependant, so it does not seem ...

13. InputStream duplication, how to ?    coderanch.com

Hi I have a problem with InputStream (FilterInputStream) in my application. I would like to start with reminding the point that "Once an input stream is read, we cannot read it again". Any comments ? Now, my question is, Is there any possibility to duplicate the input stream i have such that i can use the original / duplicate and pass ...

14. How to get both ErrorStream and InputStream of a Process    coderanch.com

Dear All, I have stuck at a place while creating an application. I tell you the situtation. I am creating a program in which I have to call an external Batch program from my code, for that I am using following lines of code: String[] str = { "cmd.exe", "/c", "di123r" }; Process pr = null; try { pr = rt.exec(str); ...

15. Multiple Files in an InputStream    coderanch.com

Hello, I have a method that takes an arraylist of tif objects and sends them to another method to extract them from a database and put them into a HttpServletResponse to be sent to a tiff viewer applet running in a jsp. My problem is that I need to send multiple files to the applet in a single stream for the ...

16. inputStream openStream    coderanch.com

Hello Java friends, I am struggling here with an issue which I couldn't figure out how to handle. Basically I am sending queries to google and returning links and then opening streams to each of these urls. Here is my UrlReader class: import java.io.*; import java.net.*; public class UrlReader { private String urlPath; private String content; public UrlReader(String name) throws IOException ...





17. Size of an InputStream    coderanch.com

Good morning everyone, one (simple) question, regarding these lines of code: this.in = this.urlConHttp.getInputStream( ); ObjectInputStream oin = new ObjectInputStream( in ); Collection result = ( Collection ) oin.readObject( ); Now, i want to know how "big" the InputStream is, that was transmitted. Is there a simple solution? Thanks in advance Andr

18. File Input Stream    coderanch.com

i have a text file that i want to read to be my input into my database in db4o. i was looking through the websites. like http://java.sun.com/javase/6/docs/api/java/io/FileInputStream.html and http://www.java2s.com/Code/JavaAPI/java.io/FileInputStreamavailable.htm there were different types too. like FileReader, FileInputStream. can anyone explain to me the differences between this two? below is an example on how inside my text file is going to look ...

19. Saving a Inputstream to file    coderanch.com

Hi, I am saving a inputstream to a temp File (for accessing the stream more than once). But I think thats a kind of "ugly" code. Is there a better way to implement this? Here the code: public class TempXmlFile { private File tempFile; public TempXmlFile(InputStream in) throws IOException { this.init(in); } private void init(InputStream in) throws IOException { tempFile = ...

20. Regarding InputStream doubts..    coderanch.com

21. Getting the InputStream for a Class    coderanch.com

Hi, I am writing a distributed application where I need to load classes from remote nodes. For this purpose, I wrote a custom class loader, which attempts to get the byte[] for a remote class, and then use the ClassLoader.defineClass() method to define the class. However, I am unable to get the byte[] of the class in the remote machine. Currently, ...

22. sequence input stream    coderanch.com

23. String to InputStream ?    coderanch.com

24. Input Stream 0 when opening the serial port with different baud rates.    coderanch.com

Hi, I have two serial devices with different baud rates. One is the end device with baud rate 9600 and the other is the coordinator with baud rate 38400. My application is supposed to detect the connected device by sending a command. 1. I open the port with 9600 baud rate, send a command and wait for reply. If I get ...

25. Catching InputStream from Runtime/Process    coderanch.com

I have a .cmd file - say - with the following code: echo "I am a command that produces a lot of text output" I want to invoke this using Runtime.getRuntime().exec(.) and catch the "I am a command that produces a lot of text output" text in the InputStream being returned from the Process. The problem is that I *must* start ...

26. get properties as input stream    coderanch.com

In this case you're loading a resource off the CLASSPATH. In order for Java to find CLASSPATH for you it needs to start with the class you are currently in and 'work its way up to find the CLASSPATH that the class is running in' (That's the non technical/Java explanation). I know others will have more accurate explanations than this and ...

27. Input Stream    coderanch.com

Hi friends, I'm facing a strange problem over here. I'm trying to post a request to HttpServlet. In between I have a small JAVA application which reads the request body from imputStream and streams the same(along with headers) to the servlet. Due to legacy reasons we are using BufferedReader and thus read in achar array instead of byte. This all works ...

28. Translate CharSet of InputStream    coderanch.com

I am using an external library that reads bytes from an InputStream and assumes that it is UTF-8 text while it is actually text in another char encoding. So I need to translate the actual bytes from ISO-8859-15 (or so) to UTF-8. What I want to avoid is to have to read the entire stream into a String first. Any ideas? ...

29. InputStream    coderanch.com

Hi all, Can someone here give me an example of how to create a method that takes an InputStream as an parameter, reads the stream and returns the number of characters it contains as an int? It could be a actual Java code ot a pseudo code. I just need something to start me off with a method i'm creating. Thanks. ...

30. MD5 checksum, can i do this faster , from a inputstream ?    coderanch.com

I calculate a MD5 checksum, from a inputstream, but with this code i read the 1 mb data to calculate the MD5...... Its not allsays 1 mb, it can be from 50 kb ---> 50 mb Is there anyone, that knows if i can do this faster..... java.security.MessageDigest md5er = MessageDigest.getInstance("MD5"); byte[] buf = new byte[8192]; int num = 0; int ...

31. InputStream,how to use    coderanch.com

32. Creating an InputStream from a String    coderanch.com

33. File decorator for an input stream    coderanch.com

Hello, I am using a commercial library which extract text from PDF files. The library is adapted to many programming languages, so the API is the least common denominator among them. The only way for the library to read a PDF document is from the file system. The sole open_document() call takes a name of the file as its parameter. In ...

34. Using Channels with the InputStream of a Process    coderanch.com

I'm attempting to use a channel with the input stream of a process. I want this to be non-blocking. However, no matter what, it does block once its ready everything available. Channels.newChannel(process.getInputStream()).read(byteBuffer) -> stalls if everything read!! Is there any way to make it nonstalling? What im trying to do is create a thread which analyzes a stream for a certain ...

35. Unable to get terminate character in InputStream    coderanch.com

Hi everybody, I am Chaitanya, I am reading a data from Serial port. A radio frequency identification kit kis connected to the serial port, it actually sends the data to the serial port. My job is to read the data from it. I am using InputStream class to read data from serial port. while ((c=inputStream.read())!=10) { if(c!=13) readBuffer.append((char) c); //code for ...

36. InputStream, UTF-8/16 und Strings    coderanch.com

Hello, I'm working on a project these days, where I'm not responsible for the framework I have to work within. Now, ther are some problems with the encoding and special characters: I've got to process text from an InputStream, and return an InputStream itself again. For this processing, I need the complete String from the given InputStream. Furthermore, I have to ...

37. inputStream freezes    coderanch.com

Hi. I have problem with my aplication. You must run it with argument 0(for server) and 1(for client). import java.io.*; import java.net.*; import java.security.*; import java.util.Arrays; import java.util.Scanner; import java.util.concurrent.TimeUnit; import javax.crypto.*; public class Szyfr implements Serializable { public static void main(String[] args) throws NoSuchAlgorithmException, InvalidKeyException, NoSuchPaddingException, IOException, ClassNotFoundException, InterruptedException, IllegalBlockSizeException { new Szyfr().dzialaj(args[0]); } public void dzialaj(String op) throws NoSuchAlgorithmException, ...

38. How do I get a FileReader from an InputStream?    coderanch.com

Hi, I'm using Java 1.6. How can I get a FileReader object from an InputStream object? The origin of this problem is that I have a Spring 3 controller that passes me a MultipartFile object, which has a "getInputStream" method and I'm trying to create another object (CsvBeanReader), whose constructor takes a FileReader object. Thanks, - Dave

39. InputStream and its size    coderanch.com

Hello, following problem: i want to build a audio player which retrieves an InputStream from the HttpClient (Apache HttpClient) and play it (i use JLayer for the playback). I can play the audio streams without any problem, but i cannot "scroll in the stream", because i dont know how much has been already downloaded into ram. I found the skip method ...

40. Create InputStream from org.w3c.dom.Document    coderanch.com

Hi everyone, I am writing a packing and unpacking routine that converts an object to and from XML for the purpose of sending data (XML) over http. I am using the org.apache.commons.httpclient API. Specifically, I intend to call the setRequestEntity(RequestEntity) method of the PostMethod class. In creating a RequestEntity, I am required to pass an InputStream to the constructor. What I ...

41. [JAVA] Endoding an InputStream    coderanch.com

Hello, I have a problem with encoding in my project. I am developing a proxy, I get remote files. xml. Some of these have UTF-8 encoding (the type of coding that I intend to return to the client). Other, different encoding (ISO-8859-1). The xml returned by remote is converted to json from inputStream in this way. JSON json = new XMLSerializer ...

42. InputStream    coderanch.com

Guys!!! if i close a InputStream after using it, how i get it to work again?? i mean the same one?? In my code m doing something like this, InputStream inStream; ......................... ......................... inStream = serPort.getInputStream(); //inside method A (some code) inStream.close(); //inside method B when i call method A again, it doesn't work. Is there a reason for that??

43. Creating inputstream from MulticastSocket    coderanch.com

MulticastSocket works with datagram packets, not streams. The reason is because the underlying protocol, UDP, does not guarantee any of these packets to arrive, or for them to arrive in the order they were sent. You can create a new InputStream sub class around the MulticastSocket that reads the packets and let its read methods return the data from these packets. ...

44. InputStream to fileReader    coderanch.com

45. Creating an InputStream    java-forums.org

Hi, What i'm doing is trying to send ssh commands using java to a server. I'm using the Jsch package to do this. The ssh part works, what i'm having trouble with is sending the commands to the server. There is an example which creates a shell in the console, it looks like this: Java Code: public class Shell { public ...

46. Java InputStream    java-forums.org

Java Code: protected final void checkIncomingPacket(int command, int length) { System.out.println("Command: " + command); } public int readPacket(byte data[]) { try { packetReadCount++; if (1000 > 0 && packetReadCount > 1000) { error = true; return 0; } if (length == 0 && gameServerInputStream.available() >= 2) { length = gameServerInputStream.read(); if (length >= 160) length = (length - 160) * 256+gameServerInputStream.read(); ...

47. InputStream problem    java-forums.org

I have written 3 arrays to disc using:- public void saveData(){ try{FileOutputStream f_out= new FileOutputStream("mydata.zzz"); ObjectOutputStream obj_out =new ObjectOutputStream (f_out); obj_out.writeObject(scores); obj_out.writeObject(props); obj_out.writeObject(things);} catch (IOException e) {System.out.println(" A write error has occurred"); When I try to read them back I am having problems with the 4thline of code getting javac errors. I have tried the following-errors shown alongside each try. What ...

48. Input stream error    java-forums.org

I am getting an error when compiling. My focus is to generate 2 random numbers.. ex: (2*2) and have the user guess the answer. If the answer is correct, it will say correct and close out. If they are incorrect, It should say try again.. Right now I am stuck at the code below. Here is my error: java:27: cannot find ...

49. Problem with InputStream    java-forums.org

I'm no expert in this, so please take this with a grain of salt, but perhaps you're reading to the end of the stream in the first method, and then passing a Stream where the stream position is at the end of the Stream. Does the InputStream that you're using support marking? If so have you tried calling mark(int readLimit) at ...

50. InputStream problem    forums.oracle.com

And other thing why then when I try to acces to the InputStream from another class it says that it is at the end of the InputStream. I think that you can read the information of an InputStream once or Is it another way to do that to read it more than one time?

51. how to use InputStream    forums.oracle.com

52. Simple input stream    forums.oracle.com

I can't understand you. You said: 1. I just want a "simple" code where the input stream is used. 2. I have searched and found different solutions, but none of them work like they should. So you not only want "code where the input stream is used", you have some requirements and existing code did not fit into. Again - what ...

53. Java InputStream    forums.oracle.com

Dear Forum,, I'm fairlynew to java and I would like to develop a real-time text to mysql mapper. You see I have a stream of 5 columns coming through a linux tail, and I would like to pipe it (in linux shell) to the java app that will split the line into 5 and from there on I can manage. I'm ...

54. InputStream Mark Not Supported    forums.oracle.com

I am doing a college project where I need to take a number of files, split them into bytes and place the bytes into packets of size 80 bytes. I am using an Input Stream to read the bytes, 80 at a time. My idea was to use the Mark() and reset() methods to do this but these methods are not ...

55. Input stream    forums.oracle.com

57. Detecting end of stream in Inputstream    forums.oracle.com

58. InputStream not returning end of file    forums.oracle.com

I am having a problem regarding inputstream and the -1 that it is supposed to return. I have a server that returns an audio file when an english text is given. The server that I am using is the Festival server created by University of Edinburgh. The client that I wrote provides the server with an english text and in return ...

59. input stream    forums.oracle.com

60. to get InputStream of a Process    forums.oracle.com

Hi i am trying to run a java program using Process class here is the code Runtime p =Runtime.getRuntime(); String a1= "java \"C: Program Files\\Java\\jdk1.6.0_07\\bin\\First\" "; Process r=p.exec(a1); BufferedReader bread= new BufferedReader(new InputStreamReader(in)); String st; while((st=bread.readLine())!=null) { System.out.println(st); } First is a compiled java code i want to run the file instead of printing the output of the program i want ...

61. some query regarding mark(readlimit) in inputstream    forums.oracle.com

public static File createFile(InputStream in, String sfilename) throws FileNotFoundException, IOException { InputStream byteArrayInputStream = in; String outStr = byteArrayInputStream.toString(); File newFile = new File(sfilename); FileOutputStream fos = new FileOutputStream(newFile); int data; while ((data = byteArrayInputStream.read()) != -1 ) ) { char ch = (char) data; fos.write(ch); } fos.flush(); fos.close(); return newFile; } I am expecting that 10 files are created ...

62. InputStream truncates after 8192 bytes    forums.oracle.com

I assume from the beginning of your screen name that you live in the same city that I live in. Anyway that code you posted doesn't read anything into an InputStream at all. It just puts data into some byte array which we can't see the definition of. From your post it's possible it's declared to be 8192 bytes, I suppose. ...

63. InputStream size    forums.oracle.com

It can't be done because an InputStream doesn't necessarily have a size. It's even possible for an InputStream to return an unlimited amount of data. So you are going to have to revise your requirements. Yes, if you have a File then you have an object whose size you can determine. But given an InputStream you can't find out what file ...

64. Creating InputStream problem    forums.oracle.com

Well, as the API documentation says (even with an example), the JRE is going to look for "/spalicky/Main/kombinace.txt" with respect to your classpath. Your Main class is in that directory so if you put the file in the same directory, that should work. That's assuming that your Main class is in the spalicky package (you didn't say that but your code ...

65. InputStream    forums.oracle.com

I've initialize an integer to zero. I then start the loop with the first character, go to the last one and keep incrementing unless the string finishes. I have to use InputStream as the parameter. So i use BufferedReader to read the InputStream and convert the inputstream into String, then count the number of characters in the String.

66. InputStream errors    forums.oracle.com

67. InputStream problem    forums.oracle.com

Hello, I need to create a function where input parameter is an InputStream. And I need to read this stream into byte[] and return it from function. The question is how? The problem is I don't know size of data in the InputStream. So it is problem to create byte[] with appropriate size at the beginning. I tried to input data, ...

68. Problems with special characters in InputStream or XPath    forums.oracle.com

Does the response to the HTML request include a header which specifies the encoding? That should be the encoding the parser uses to decode the XML document in the request. It's quite common for RSS to screw up the encoding of quotes when the feed producers just paste them in from say a MS Word document, so perhaps the data is ...

69. Get InputStream from file on disk?    forums.oracle.com

71. Simple question about InputStream.readFully method.    forums.oracle.com

The most important difference is that InputStream doesn't have either a readFully() or a readByte() method. Those methods are specified in the DataInput interface, implementations of which are used for reading data in certain binary formats. The read(byte[]) methods are lower-level methods that can be used for text or binary data. I don't know what you mean when you say read(byte[], ...

72. Execute external program, ErrorStream and InputStream    forums.oracle.com

I use this command to launch new process: Process proc = Runtime.getRuntime().exec(cmd); as stated in java doc The methods that create processes may not work well for special processes on certain native platforms, such as native windowing processes, daemon processes, Win16/DOS processes on Microsoft Windows, or shell scripts. The created subprocess does not have its own terminal or console. All its ...

73. having trouble directing inputstream of process to a text area!    forums.oracle.com

It looks to me like you are running this in the Swing event thread so the GUI is not able to respond. If so, then you should run the whole in a separate thread and update the Swing component using SwingUtilities.invokeLater(). You might find this easiest using the SwingWorker class which does most of the hard work for you. P.S. You ...

74. mark/reset method not supported for InputStream?    forums.oracle.com

Hi. I am working on a program and I basically want to mark the stream so that I can come back to it if I find a certain keyword in the current section of the stream I'm reading at. However, I get "java.io.IOException:mark/reset not supported" and I used the markSupported() method to check and it verifies that it is not supported. ...

75. InputStream    forums.oracle.com

76. process InputStream handling woes    forums.oracle.com

localExec2 help Successfully read from console 6 bytes Successfully read 49 bytes Commands may be abbreviated. Commands are: help Successfully read from console 6 bytes Successfully read 49 bytes Commands may be abbreviated. Commands are: bye Successfully read from console 5 bytes Successfully read 548 bytes ! delete literal ...

78. Search within inputStream    forums.oracle.com

79. int available() method in abstract class java.io.InputStream    forums.oracle.com

I can't find any particular reason why this method returns an int value and not a long. It's clearly shown that the java developers thought that an InputStream could have a length that would have to be expressed as a long value, because skip takes a long as an argument. I first noticed that this method returning an int could be ...

80. end of inputstream    forums.oracle.com

How does the input stream reader knows that there is an end of input stream. The context in which the question arised is the following. When I use socket to connect to a standard server it works fine. When I connect to some custom server then the socket gets stuck in loop while reading the input stream from the server. My ...

82. getting original file from InputStream    forums.oracle.com

I have an InputStream opened on some File. Is it possible to get information about File from this InputStream or can I get filename of the file on which this InputStream is oepned ? Skipping past what everybody else has said about different types of InputStream, you can't get the original filename back from a FileInputStream because (1) the original JDK ...

83. Getting information from a process' input stream continuosly    forums.oracle.com

You should certainly read p://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html and implement the recommendations. As it stands, you code exhibits at least two of the traps. Also, you may be falling foul of a 'feature' of stdout. On most (many?) OS, stdout is buffered when not writing to the console and the output is not written until either the buffer becomes full or until the process ...

84. InputStream error    forums.oracle.com

@ejp That IS returning null--- this is clear from the part from where the exception is generated (the 'lock' object being passed is null). The point is to get it working i.e. is there a way to find out why is it giving a null? Can that be avoided and the code made to work?

85. Download file with Inputstream. How to determine size?    forums.oracle.com

Hello, I'm able to download files from Internet with an InputStream but i want to determine the total file size in order to make a nice progressbar. I tried the available() method but this only returns the number of bytes in the buffer. How can i do this? Any ideas? Thanks in advance, Bart

86. InputStream problem    forums.oracle.com

87. InputStream to String and back to InputStream    forums.oracle.com

Fairly new to I/O I have a socket connection made to the server and I obtain the InputStream InputStream is = socket.getInputStream(); I need to convert is to a String, I need to append another string to it . Convert it back to Input Stream and pass to BufferedReader in = new BufferedReader(new InputStreamReader(is)); How do I do this? thnx

88. [multithread] newbie here ... is inputStream shared?    forums.oracle.com

Hi, a newbie here. I've been playing with java for six month now and it's been pretty fun. Looking forward to learn more about java from this forum. Now I have a question about this little project I've been doing. I'm currently developing a multi-threaded client-server application (both client and server are multi-threaded). The idea is very easy which is to ...

89. How to use InputStream to create a file?    forums.oracle.com

90. How can I use an Inputstream twice?    forums.oracle.com

Hi, my Servlet receives HTTP-POSTs with XML streams as content (the InputStream). This xml file will be checked with a XSD and then "forwarded" to another server. ( A->Servlet->B). Because I read the InputStream while checking if the stream is valid I have to get the stream one more time to send it to B.

91. Problem with method available() from InputStream using RXTX API    forums.oracle.com

The available() method is often unreliable and can have different semantics on implementations. You should not use it especially for networking applications. Instead you should depend on the return value -1 and other EOF conditions including exceptions for read end. If you want a single string for the next output, use StringBuffer or StringBuilder for appending the result from each read() ...

92. Passing InputStream to another method    forums.oracle.com

Maybe you can't create a new BufferedReader on on open InputStream. Try passing the BufferedReader around. If you need further help then you need to create a "Short, Self Contained, Compilable and Executable, Example Program (SSCCE)", see http://homepage1.nifty.com/algafield/sscce.html, that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided. For example your simple ...

93. mark() of inputstream class    forums.oracle.com

94. Unclosed File input stream , Any performance implications?    forums.oracle.com

Hi, I open a file input stream as below and read the contents of a file and exit from the method without closing the input stream [fin.close()]. 1) What are the implications of not closing input stream, performance related?. 2) Since fin is a local variable once the method terminates the variable will be destroyed, In this do i still need ...

95. Problem getting a C application stdout using Process and InputStream.    forums.oracle.com

[ebank2@giskard ~/ivan]$ java a 2007-06-29 11:41:10.707 Fri Jun 29 11:41:10 CEST 2007 2007-06-29 11:41:11.72 Fri Jun 29 11:41:11 CEST 2007 2007-06-29 11:41:12.734 Fri Jun 29 11:41:12 CEST 2007 2007-06-29 11:41:13.744 Fri Jun 29 11:41:13 CEST 2007 2007-06-29 11:41:14.754 Fri Jun 29 11:41:14 CEST 2007 2007-06-29 11:41:15.766 Fri Jun 29 11:41:15 CEST 2007 2007-06-29 11:41:16.777 Fri Jun 29 11:41:16 CEST 2007 2007-06-29 ...

96. InputStream null problem    forums.oracle.com

Sorry it took so long to reply-- I'm using Eclipse 3.2, and I have a project called BookProject. Inside BookProject is a package called bookViewer. Inside bookViewer are three classes: BookScreen, BookViewer (which has the main method) and BookReader. The package also contains the file book.txt. I'm trying to use an InputStream instantiated in BookReader.java to read in book.txt. I hope ...

97. Open file as InputStream    forums.oracle.com

98. InputStream missing CR    forums.oracle.com

99. How to get first bytes value from an InputStream?    forums.oracle.com

Hello, I'm scanning a database for pictures and retreive them through a call to ResultSet.getBinaryStream(1) that gives me an InputStream. I would like to scan the first 2 bytes to know if the returned stream is a JPEG picture (first 2 bytes must be 0xFF and 0xD8). I can see them in the protected "buf" member of InputStream in the debugger ...

100. InputStream internals    forums.oracle.com

Hi Thanks for the response. Captain.Obvious: I have gone through the source code . But the problem was most of the methods are native eg FileInputSream which extends InputStream has read method as native. So i was asking as to if u know internally how it reads. ejp : Thanks for the answer. So if it doesnt create a byte array ...