public static List<Tag<?>> readFile(File f) { List<Tag<?>> list = new ArrayList<Tag<?>>(); try { FileInputStream fis = new FileInputStream(f); DataInputStream dis = new DataInputStream(fis); boolean eof = false; while (!eof) { int value; String key; try { value = dis.readInt(); } catch (EOFException e) { eof = true; continue; } key = dis.readUTF(); list.add(new IntTag(key, value)); } return list; } catch (IOException ioe) { return null; } } }
/** * Writes a {@code TAG_Int} tag. * * @param tag The tag. * @throws java.io.IOException if an I/O error occurs. */ private void writeIntTagPayload(IntTag tag) throws IOException { os.writeInt(tag.getValue()); }
public static List<Tag<?>> readFile(File f) { List<Tag<?>> list = new ArrayList<Tag<?>>(); try { FileInputStream fis = new FileInputStream(f); DataInputStream dis = new DataInputStream(fis); boolean eof = false; while (!eof) { int value; String key; try { value = dis.readInt(); } catch (EOFException e) { eof = true; continue; } key = dis.readUTF(); list.add(new IntTag(key, value)); } return list; } catch (IOException ioe) { return null; } } }
/** * Writes a {@code TAG_Int} tag. * * @param tag The tag. * @throws java.io.IOException if an I/O error occurs. */ private void writeIntTagPayload(IntTag tag) throws IOException { os.writeInt(tag.getValue()); }
public static List<Tag<?>> readFile(File f) { List<Tag<?>> list = new ArrayList<Tag<?>>(); try { FileInputStream fis = new FileInputStream(f); DataInputStream dis = new DataInputStream(fis); boolean eof = false; while (!eof) { int value; String key; try { value = dis.readInt(); } catch (EOFException e) { eof = true; continue; } key = dis.readUTF(); list.add(new IntTag(key, value)); } return list; } catch (IOException ioe) { return null; } } }
/** * Writes a {@code TAG_Int} tag. * * @param tag The tag. * @throws java.io.IOException if an I/O error occurs. */ private void writeIntTagPayload(IntTag tag) throws IOException { os.writeInt(tag.getValue()); }
return new IntTag(name, is.readInt());
return new IntTag(name, is.readInt());
return new IntTag(name, is.readInt());