Article View: borland.public.jbuilder.java.language
Article #17278Writing data from socket to disk
From: Rod Brick
Date: Tue, 24 Nov 1998 00:00
Date: Tue, 24 Nov 1998 00:00
19 lines
1080 bytes
1080 bytes
I'm trying to send some data from an input stream to a file, but I don't know the best way to do this. Currently I'm reading from the socket via a BufferedReader, something like this: in = new BufferedReader(new InputStreamReader(sock.getInputStream())); in.read(cbuf, 0, bytes); This seems to be inefficient, but I'm at a loss for a better way. I need to be able to specify the actual number of bytes read, that's why I'm using the read(char cbuf[], int offset, int len) method. Any hints here would be appreciated. -- Rod Brick PSW Technologies Austin, Texas http://www.psw.com
Technical Details
Message-ID:
<365B1DCE.B7E0D25C@pswtech.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,fb4ca0339cc4bedb,start X-Google-Attributes: gidf74b3,public From: Rod Brick <rbrick@pswtech.com> Subject: Writing data from socket to disk Date: 1998/11/24 Message-ID: <365B1DCE.B7E0D25C@pswtech.com> X-Deja-AN: 415292336 Content-Transfer-Encoding: 7bit Organization: PSW Technologies Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language