1 46 50 package org.mr.core.util.byteable; 51 52 import java.io.IOException ; 53 54 69 public class ByteableText implements Byteable { 70 71 private String underLine; 72 73 76 public ByteableText(String underLine ) { 77 this.underLine =underLine; 78 } 79 80 83 public String getByteableName() { 84 85 return "BText"; 86 } 87 88 91 public void toBytes(ByteableOutputStream out) throws IOException { 92 out.writeUTF(underLine); 93 94 } 95 96 99 public Byteable createInstance(ByteableInputStream in) throws IOException { 100 101 return new ByteableText(in.readUTF()); 102 } 103 104 107 public void registerToByteableRegistry() { 108 ByteableRegistry.registerByteableFactory(getByteableName() , this); 109 } 110 111 public static void register(){ 112 ByteableText instance = new ByteableText(""); 113 instance.registerToByteableRegistry(); 114 } 115 116 public String toString(){ 117 return underLine; 118 } 119 120 } 121 | Popular Tags |