コード例 #1
0
 public static void load(final String filename) throws IOException {
   final ByteBuffer buffer = ByteBuffer.wrap(ContentFileHelper.readFile(filename));
   buffer.order(ByteOrder.LITTLE_ENDIAN);
   for (int numElements = buffer.getInt(), i = 0; i < numElements; ++i) {
     add(new ElementProperties(buffer));
   }
   ElementPropertiesLibrary.m_elements.trimToSize();
 }
コード例 #2
0
 private void init(final String fileName) throws Exception {
   final BufferedReader reader =
       new BufferedReader(new InputStreamReader(ContentFileHelper.openFile(fileName), "UTF-8"));
   String line;
   while ((line = reader.readLine()) != null) {
     if (!line.isEmpty()) {
       this.m_names.add(line);
     }
   }
   reader.close();
 }