This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

how to read a whole plain text file


Greetings to all,

  I have a problem again.

  What I need is to read plain text file and represent its contents as
  an array of bytes (byte[]) so that it could be passed to another
  Java function (void setData(byte[] data)).

  I have tried different approaches, but failed. (I have tried to
  `read' it, but `read' reads only the first line of the file, with
  read-line I am failing to `glue' the lines into a single one,
  opening an output string and then (write-char (read-char infile)
  outstr) causes a class cast exception).

  What is the preferred/right way to read a whole file? Our, how would
  you solve that task?

With best regards,
-- 
Victor Anyakin                         ()  ascii ribbon campaign
                                       /\    - against html mail


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]