The Artima Developer Community
Sponsored Link

Java Answers Forum
write/read two byte arrays to one file- help!

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Lana Al

Posts: 1
Nickname: leshep
Registered: Nov, 2009

write/read two byte arrays to one file- help! Posted: Nov 26, 2009 12:50 PM
Reply to this message Reply
Advertisement
i'm doing a java program, and i have to store two byte arrays to one file and read them back in another class, how can i do that? i know how to do it with one array using FileInputStream, the code as below:


 String KeyFilename="EncStrfile";  
    File file = new File(KeyFilename);
    FileInputStream fis=new FileInputStream(file);
    byte[] enckeyarray=new byte[(int) file.length()];
    fis.read(enckeyarray);
    fis.close();


but how can i store two byte arrays in one file and read them back??

Topic: help.. Previous Topic   Next Topic Topic: a java error I don't understand ?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use