Debian Codegraph @

freehep-graphicsio-swf/src/main/java/org/freehep/graphicsio/swf/FileAttributes.java

raw symbols SCIP
1 // Copyright 2006, FreeHEP.
2 package org.freehep.graphicsio.swf;
3
4 import java.io.IOException;
5
6 /**
7 * FileAttributes TAG.
8 *
9 * @author Mark Donszelmann
10 * @version $Id: freehep-graphicsio-swf/src/main/java/org/freehep/graphicsio/swf/FileAttributes.java fe6d709a107e 2006/11/27 18:25:46 duns $
11 */
12 public class FileAttributes extends ControlTag {
13
14 private boolean hasMetadata;
15 private boolean useNetwork;
16
17 public FileAttributes() {
18 super(69, 1);
19 }
20
21 public SWFTag read(int tagID, SWFInputStream swf, int len)
22 throws IOException {
23
24 FileAttributes tag = new FileAttributes();
25 swf.readUBits(2);
26 tag.hasMetadata = swf.readBitFlag();
27 swf.readUBits(3);
28 tag.useNetwork = swf.readBitFlag();
29 swf.readUBits(24);
30
31 return tag;
32 }
33
34 public void write(int tagID, SWFOutputStream swf) throws IOException {
35
36 swf.writeUBits(0, 2);
37 swf.writeBitFlag(hasMetadata);
38 swf.writeUBits(0, 3);
39 swf.writeBitFlag(useNetwork);
40 swf.writeUBits(0, 24);
41 }
42
43 public String toString() {
44 StringBuffer s = new StringBuffer();
45 s.append(super.toString() + "\n");
46 s.append(" hasMetaData: " + hasMetadata + "\n");
47 s.append(" useNetwork: " + useNetwork + "\n");
48 return s.toString();
49 }
50 }