1 16 17 package org.apache.poi.hpsf; 18 19 import java.io.IOException ; 20 import java.io.OutputStream ; 21 22 33 public class MutableProperty extends Property 34 { 35 36 40 public MutableProperty() 41 { } 42 43 44 45 51 public MutableProperty(final Property p) 52 { 53 setID(p.getID()); 54 setType(p.getType()); 55 setValue(p.getValue()); 56 } 57 58 59 64 public void setID(final long id) 65 { 66 this.id = id; 67 } 68 69 70 71 76 public void setType(final long type) 77 { 78 this.type = type; 79 } 80 81 82 83 88 public void setValue(final Object value) 89 { 90 this.value = value; 91 } 92 93 94 95 106 public int write(final OutputStream out, final int codepage) 107 throws IOException , WritingNotSupportedException 108 { 109 int length = 0; 110 long variantType = getType(); 111 112 113 if (codepage == Constants.CP_UNICODE && variantType == Variant.VT_LPSTR) 114 variantType = Variant.VT_LPWSTR; 115 116 length += TypeWriter.writeUIntToStream(out, variantType); 117 length += VariantSupport.write(out, variantType, getValue(), codepage); 118 return length; 119 } 120 121 } 122 | Popular Tags |