Article View: borland.public.jbuilder.java.language
Article #17856Re: Random Access File
From: Brian Burton
Date: Fri, 11 Sep 1998 00:00
Date: Fri, 11 Sep 1998 00:00
32 lines
1418 bytes
1418 bytes
Sam C. King wrote:
>
> I have tried in vane, just about everything I can think
> of to create the simple file outlined in deitel's book
> on p777, with no luck.
>
> From what I've read, I really thought that the following
> was going to work:
>
> String s1 = "abc";
> byte[] b1 = new byte[15];
> b1 = s1.getBytes();
> raf.write(b1,0,15);
>
b1 is not a 15 byte array. When you assigned
b1 = s1.getBytes()
you replaced your 15 byte array with a 3 character array. That is the
source of your problem.
All the best,
++Brian
--
Brian Burton mailto:brian@burton-computer.com
Burton Computer Corporation http://www.burton-computer.com
Custom software development using Java, C++, and CORBA.
Creators of BC!JNews, the all Java NNTP discussion server.
"Why just spin a web when you could build a community?"
Technical Details
Message-ID:
<35F95D68.A85535AB@burton-computer.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<35D62B58.DF97BDCA@olypen.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,2ac3827aa401f7bc X-Google-Attributes: gidf74b3,public From: Brian Burton <brian@burton-computer.com> Subject: Re: Random Access File Date: 1998/09/11 Message-ID: <35F95D68.A85535AB@burton-computer.com> X-Deja-AN: 390174631 Content-Transfer-Encoding: 7bit References: <35D62B58.DF97BDCA@olypen.com> Content-Type: text/plain; charset=us-ascii Organization: Burton Computer Corporation Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language