1 22 23 package com.ice.jni.registry; 24 25 import java.io.PrintWriter ; 26 27 28 35 36 public class 37 RegStringValue extends RegistryValue 38 { 39 String data; 40 int dataLen; 41 42 43 public 44 RegStringValue( RegistryKey key, String name ) 45 { 46 super( key, name, RegistryValue.REG_SZ ); 47 this.data = null; 48 this.dataLen = 0; 49 } 50 51 public 52 RegStringValue( RegistryKey key, String name, int type ) 53 { 54 super( key, name, type ); 55 this.data = null; 56 this.dataLen = 0; 57 } 58 59 public 60 RegStringValue( RegistryKey key, String name, String data ) 61 { 62 super( key, name, RegistryValue.REG_SZ ); 63 this.setData( data ); 64 } 65 66 public String 67 getData() 68 { 69 return this.data; 70 } 71 72 public int 73 getLength() 74 { 75 return this.dataLen; 76 } 77 78 public void 79 setData( String data ) 80 { 81 this.data = data; 82 this.dataLen = data.length(); 83 } 84 85 public byte[] 86 getByteData() 87 { 88 return this.data.getBytes(); 89 } 90 91 public int 92 getByteLength() 93 { 94 return this.dataLen; 95 } 96 97 public void 98 setByteData( byte[] data ) 99 { 100 this.setData( new String ( data ) ); 101 } 102 103 public void 104 export( PrintWriter out ) 105 { 106 if ( this.getName().length() == 0 ) 107 out.print( "@=" ); 108 else 109 out.print( "\"" + this.getName() + "\"=" ); 110 111 out.println( "\"" + this.getData() + "\"" ); 112 } 113 114 } 115 116 117 118 119 | Popular Tags |