Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 508 results for
bufferedinputstream
- Page 1
Re: Download multiple files in single zip and render for download
Programming
Software Development
2 Months Ago
by Sachin_41
what is _response in this? Is this some library?
BufferedInputStream versus read() call with byte array as parameter
Programming
Software Development
13 Years Ago
by daudiam
Using a
BufferedInputStream
is useful because it cuts down on read system calls. But the same effect can be produced, say in reading a file, if we use FileInputStream's read method that takes a byte array as input. A lot of bytes are read in a single call. Am I right ? Then, why is it that we need to wrap it inside a
BufferedInputStream
object ?
Re: BufferedInputStream versus read() call with byte array as parameter
Programming
Software Development
13 Years Ago
by daudiam
I assume you are talking of the advantages of using a
BufferedInputStream
object to wrap a FileInputStream object. But, we can control the read size of the buffer with FileInputStream too (changing the size of the byte array we pass as argument to it). Secondly, I couldn't find the readLine() method in the documentation for
BufferedInputStream
.
Re: BufferedInputStream versus read() call with byte array as parameter
Programming
Software Development
13 Years Ago
by daudiam
Thanks. You gave 2 main arguments in favour of
BufferedInputStream
, but : 1. Line endings are still hacked as there is … pass to the read() function. Then, why should be use
BufferedInputStream
? We can already have the buffering facility via the proper…
Re: BufferedInputStream versus read() call with byte array as parameter
Programming
Software Development
13 Years Ago
by masijade
Okay, readLine is BufferedReader. In any case, those things I mentioned are using InputStream,
BufferedInputStream
handles those things for you.
Re: BufferedInputStream versus read() call with byte array as parameter
Programming
Software Development
13 Years Ago
by masijade
Whether you want to do the work yourself, or you want to control the read size of the buffer, or you don't want line endings getting hacked off (if using readLine), etc, etc.
Re: BufferedInputStream versus read() call with byte array as parameter
Programming
Software Development
13 Years Ago
by ~s.o.s~
> 1. Line endings are still hacked as there is no readLine. Raw input streams shouldn't be used for reading character data anyways so this is a moot point. Byte based streams don't have a notion of "line" hence no "readLine()" method. You make the mistake of assuming streams would always be a character based stream. > We…
Re: BufferedInputStream versus read() call with byte array as parameter
Programming
Software Development
13 Years Ago
by daudiam
Thanks a lot. I got it. One more thing. Buffering helps reduce system calls. So, even when we are reading a small file, we should buffer. But the buffering mechanism must also have its own overhead. Is the overhead so much that we should avoid buffering for small files ? That seems to be the only place where buffering should not be used.
Re: BufferedInputStream versus read() call with byte array as parameter
Programming
Software Development
13 Years Ago
by ~s.o.s~
It's a good idea to use a Buffered stream/reader even for small files. That way, if you encounter performance problems later on, you can tweak the size of the buffer and improve performance without changing a lot of code (just changing buffer size). But like all performance related things, code tweaked to specific scenarios performs much better …
Re: BufferedInputStream versus read() call with byte array as parameter
Programming
Software Development
13 Years Ago
by daudiam
Thanks a lot. Its clear now
how to broadcast voice to all clients by ip ??
Programming
Software Development
15 Years Ago
by m_sam6
…= MyService.accept(); captureAudio(); input = new
BufferedInputStream
(clientSocket.getInputStream()); out=new BufferedOutputStream(clientSocket.getOutputStream());… audioFormat; TargetDataLine targetDataLine; BufferedOutputStream out = null;
BufferedInputStream
in = null; Socket socket = null; SourceDataLine…
PDF Download Issue, Stumped
Programming
Software Development
14 Years Ago
by blur0224
…bytes being added to java.io.
BufferedInputStream
in = new java.io.
BufferedInputStream
(new java.net.URL("…So somewhere between the web server and the
BufferedInputStream
I'm getting additional bytes added in. I…args) throws IOException { java.io.
BufferedInputStream
in = new java.io.
BufferedInputStream
(new java.net.URL("http://www…
different types of communication causes multithreaded server/client to hang
Programming
Software Development
13 Years Ago
by initialise
…net.*; public class Provider implements Runnable{ ServerSocket server;
BufferedInputStream
bis; BufferedOutputStream bos; InputStreamReader isr; Socket sock; …net.*; public class ClientThread implements Runnable { ServerSocket server;
BufferedInputStream
bis; BufferedOutputStream bos; InputStreamReader isr; Socket sock; int…
Send image to client over a socket
Programming
Software Development
12 Years Ago
by masterofpuppets
…is the file to be sent to the client.
BufferedInputStream
reader = new
BufferedInputStream
( new FileInputStream( f ) ); // send OK … ); try { System.out.println( "Writing..." );
BufferedInputStream
in = new
BufferedInputStream
( new FileInputStream( testF ) ); BufferedOutputStream out = new BufferedOutputStream( new…
PLS Help newbie
Programming
Software Development
19 Years Ago
by serkanozgen
… from the specified file and store it in jta
BufferedInputStream
in = new
BufferedInputStream
(new FileInputStream(file)); byte[] b = new byte[in.available… { //Read from the output file and display in jta
BufferedInputStream
in = new
BufferedInputStream
(new FileInputStream(outfile)); byte[] b = new byte[in.available…
Constructor in maze problem
Programming
Software Development
16 Years Ago
by torbecire
… FileInputStream fis = new FileInputStream(f);
BufferedInputStream
bis = new
BufferedInputStream
(fis); dis = new DataInputStream(bis);… FileInputStream fis = new FileInputStream(f);
BufferedInputStream
bis = new
BufferedInputStream
(fis); dis = new DataInputStream(bis);…
Close javax.jms.XAConnection and XASession
Programming
Software Development
15 Years Ago
by amjad277
….read(SocketInputStream.java:162) at java.io.
BufferedInputStream
.fill(
BufferedInputStream
.java:218) at java.io.
BufferedInputStream
.read(
BufferedInputStream
.java:235) at org.jboss.util…
Trouble in Desktop sharing code
Programming
Software Development
15 Years Ago
by navinlearns
…call your function here } */ bis = new
BufferedInputStream
(dvclient.getInputStream()); // bos = new BufferedOutputStream(new …filename=file.getAbsolutePath(); bis = new
BufferedInputStream
(new FileInputStream(filename)); input =new DataInputStream…
Java Mail API problem
Programming
Software Development
11 Years Ago
by jalpesh_007
… import java.awt.event.ActionListener; import java.io.
BufferedInputStream
; import java.io.BufferedOutputStream; import java.io.BufferedWriter;… not already buffered, wrap a
BufferedInputStream
// around it. if (!(is instanceof
BufferedInputStream
)) { is = new
BufferedInputStream
(is); } int c; System…
Need help sorting a file in java
Programming
Software Development
17 Years Ago
by mojeze3
… file = new File("README.txt"); FileInputStream fis = null;
BufferedInputStream
bis = null; DataInputStream dis = null; try { fis = new… FileInputStream(file); // Here
BufferedInputStream
is added for fast reading. bis = new
BufferedInputStream
(fis); dis = new DataInputStream(bis); // dis…
.txt file reading question
Programming
Software Development
14 Years Ago
by gotm
… File(txtFile + ".txt"); FileInputStream fis = null;
BufferedInputStream
bis = null; DataInputStream dis = null; try { fis =… new FileInputStream(file); // Here
BufferedInputStream
is added for fast reading. bis = new
BufferedInputStream
(fis); dis = new DataInputStream(bis);…
won't create output .txt file :(
Programming
Software Development
14 Years Ago
by gotm
…File(txtFile + ".txt"); FileInputStream fis = null;
BufferedInputStream
bis = null; DataInputStream dis = null; // counter to …fis = new FileInputStream(file); // Here
BufferedInputStream
is added for fast reading. bis = new
BufferedInputStream
(fis); dis = new DataInputStream(bis);…
Question
Programming
Software Development
14 Years Ago
by karthickparthi
…public class Client implements ActionListener { DataOutputStream output;
BufferedInputStream
bis; BufferedOutputStream bos; byte[] receivedData; int …accept(); br = new BufferedReader(new InputStreamReader( new
BufferedInputStream
(connection .getInputStream()))); String strLine; System.out.println("…
help please
Programming
Software Development
14 Years Ago
by mgern26
… File("num.txt"); FileInputStream fis = null;
BufferedInputStream
bis = null; DataInputStream dis = null; try {… new FileInputStream(file); // Here
BufferedInputStream
is added for fast reading. bis = new
BufferedInputStream
(fis); dis = new DataInputStream(bis…
Re: FTP by web links
Programming
Software Development
13 Years Ago
by yap_1991
… URLConnection con = url.openConnection();
BufferedInputStream
in = new
BufferedInputStream
(con.getInputStream()); FileOutputStream out = new…caught or declared to be thrown
BufferedInputStream
in = new
BufferedInputStream
(con.getInputStream()); ^ D:\project1…
Re: FTP by web links
Programming
Software Development
13 Years Ago
by yap_1991
…quot;); URLConnection con = url.openConnection();
BufferedInputStream
in= new
BufferedInputStream
(con.getInputStream()); FileOutputStream out = new FileOutputStream…quot;); URLConnection con = url.openConnection();
BufferedInputStream
in= new
BufferedInputStream
(con.getInputStream()); FileOutputStream out = new FileOutputStream…
Help with assignment
Programming
Software Development
13 Years Ago
by FNHA
… br.readLine(); fstream = new FileInputStream(name); bis = new
BufferedInputStream
(fstream); dis = new DataInputStream(bis); while (dis.available()…fstream = new FileInputStream(name); bis = new
BufferedInputStream
(fstream); dis = new DataInputStream(bis); System.out…
Reading data within Tar files
Programming
Software Development
12 Years Ago
by ad_rulz
…. My code is below. [CODE]import java.io.
BufferedInputStream
; import java.io.File; import java.io.FileInputStream; …quot;; FileInputStream fis = new FileInputStream(new File(filePath));
BufferedInputStream
bis = new
BufferedInputStream
(fis); try { ArchiveInputStream input = new ArchiveStreamFactory().createArchiveInputStream(bis…
button click casues application freeze
Programming
Software Development
11 Years Ago
by khalidshakar
… is the class: import java.io.
BufferedInputStream
; import java.io.BufferedOutputStream; import java… = MyService.accept(); captureAudio(); input = new
BufferedInputStream
(clientSocket.getInputStream()); out=new BufferedOutputStream(clientSocket.getOutputStream());…
Re: button click casues application freeze
Programming
Software Development
11 Years Ago
by khalidshakar
…; public class senderThread implements Runnable{ ServerSocket MyService; Socket clientSocket = null;
BufferedInputStream
input; TargetDataLine targetDataLine; BufferedOutputStream out; ByteArrayOutputStream byteArrayOutputStream; AudioFormat audioFormat; SourceDataLine…
1
2
3
9
Next
Last
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Forums
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC