aboutsummaryrefslogtreecommitdiffstats
path: root/libs/minidns/src/main/java/de/measite/minidns/record/TXT.java
diff options
context:
space:
mode:
authorRene Treffer <treffer@measite.de>2015-01-14 22:43:43 +0100
committerRene Treffer <treffer@measite.de>2015-01-14 22:43:43 +0100
commit20eb77035659a74e749962acd85146bbf03ce3f1 (patch)
treec70aaf0c6498219741bc71352e0628d5a6b58e84 /libs/minidns/src/main/java/de/measite/minidns/record/TXT.java
parentdf742ce1e12d9909a0b1777a839e012a6dcdc78b (diff)
Switch to maven central minidns
Diffstat (limited to 'libs/minidns/src/main/java/de/measite/minidns/record/TXT.java')
-rw-r--r--libs/minidns/src/main/java/de/measite/minidns/record/TXT.java65
1 files changed, 0 insertions, 65 deletions
diff --git a/libs/minidns/src/main/java/de/measite/minidns/record/TXT.java b/libs/minidns/src/main/java/de/measite/minidns/record/TXT.java
deleted file mode 100644
index 03e73040..00000000
--- a/libs/minidns/src/main/java/de/measite/minidns/record/TXT.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package de.measite.minidns.record;
-
-import java.io.DataInputStream;
-import java.io.IOException;
-
-import de.measite.minidns.Record.TYPE;
-import de.measite.minidns.util.NameUtil;
-
-/**
- * TXT record (actually a binary blob with wrappers for text content).
- */
-public class TXT implements Data {
-
- protected byte[] blob;
-
- public byte[] getBlob() {
- return blob;
- }
-
- public void setBlob(byte[] blob) {
- this.blob = blob;
- }
-
- public String getText() {
- try {
- return (new String(blob, "UTF-8")).intern();
- } catch (Exception e) {
- /* Can't happen for UTF-8 unless it's really a blob */
- return null;
- }
- }
-
- public void setText(String text) {
- try {
- this.blob = text.getBytes("UTF-8");
- } catch (Exception e) {
- /* Can't happen, UTF-8 IS supported */
- throw new RuntimeException("UTF-8 not supported", e);
- }
- }
-
- @Override
- public byte[] toByteArray() {
- throw new UnsupportedOperationException("Not implemented yet");
- }
-
- @Override
- public void parse(DataInputStream dis, byte[] data, int length)
- throws IOException
- {
- blob = new byte[length];
- dis.readFully(blob);
- }
-
- @Override
- public TYPE getType() {
- return TYPE.TXT;
- }
-
- @Override
- public String toString() {
- return "\"" + getText() + "\"";
- }
-
-}