| 1 |
|
| 2 |
package org.freehep.graphicsio.swf; |
| 3 |
|
| 4 |
import java.io.IOException; |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 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 |
} |