Article View: borland.public.jbuilder.java.api
Article #2825Re: How to read a binary file into an byte array?
From: Maddog
Date: Fri, 28 Jan 2000 00:00
Date: Fri, 28 Jan 2000 00:00
11 lines
1235 bytes
1235 bytes
java.io.File f = new java.io.File( "filename" );
byte[] array = new byte[f.length()];
java.io.BufferedInputStream bis = new java.io.BufferedInputStream( new
java.io.FileInputStream( f ));
bis.read( array );
Don't know if the above compiles, but this should do the trick.
BTW - what's with the ridiculous cross-posting?
M.
Technical Details
Message-ID:
<CCkk4.61601$Dv1.1521683@news2.rdc1.on.home.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<949060661946@munich.ixos.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fbe9c,7805c4e1f27894f5 X-Google-Attributes: gidfbe9c,public X-Google-Thread: 1089d0,7805c4e1f27894f5 X-Google-Attributes: gid1089d0,public From: "Maddog" <mskullcap@yahoo.com.NOSPAM> Subject: Re: How to read a binary file into an byte array? Date: 2000/01/28 Message-ID: <CCkk4.61601$Dv1.1521683@news2.rdc1.on.home.com> X-Deja-AN: 578836122 References: <949060661946@munich.ixos.de> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 X-Complaints-To: abuse@home.net X-Trace: news2.rdc1.on.home.com 949081634 24.114.13.26 (Fri, 28 Jan 2000 09:47:14 PST) Organization: @Home Network Canada X-MSMail-Priority: Normal Reply-To: "Maddog" <mskullcap@yahoo.com.NOSPAM> NNTP-Posting-Date: Fri, 28 Jan 2000 09:47:14 PST Newsgroups: borland.public.jbuilder.java.api,borland.public.jbuilder.java