java - Read structured binary file -


i want read binary file in java. know file contains succession of data structures as: ansi ascii byte string, integer, ansi ascii byte string. how can read , data of file, if suppose number of data structures known (n)? see interface datainput has method readutf() read string, uses utf-8 format. how can hanle case od ascii?

the flexible (and efficient) approach, think, is:

  1. open fileinputstream.
  2. obtain filechannel using stream's getchannel() method.
  3. map channel mappedbytebuffer using channel's map() method.
  4. access data through buffer's various get* methods.

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -