1 23 24 25 package com.sun.jdo.api.persistence.enhancer.classfile; 26 27 import java.io.*; 28 29 32 33 37 38 public class ConstUnicode extends ConstBasic { 39 40 public static final int MyTag = CONSTANTUnicode; 41 42 43 private String stringValue; 44 45 46 47 50 public int tag () { return MyTag; } 51 52 55 public String asString() { 56 return stringValue; 57 } 58 59 62 public String toString () { 63 return "CONSTANTUnicode(" + indexAsString() + "): " + stringValue; } 65 66 67 68 ConstUnicode (String s) { 69 stringValue = s; 70 } 71 72 void formatData (DataOutputStream b) throws IOException { 73 b.writeBytes(stringValue); 74 } 75 76 static ConstUnicode read (DataInputStream input) throws IOException { 77 int count = input.readShort(); StringBuffer b = new StringBuffer (); 79 for (int i=0; i < count; i++) { 80 b.append(input.readChar()); 81 } 82 return new ConstUnicode (b.toString()); 83 } 84 85 void resolve (ConstantPool p) { 86 } 87 } 88 89 90 | Popular Tags |