package net.pterodactylus.rhynodge.states;
+import static java.util.Arrays.copyOf;
+
import java.io.UnsupportedEncodingException;
+import javax.annotation.Nonnull;
+
import net.pterodactylus.rhynodge.State;
import net.pterodactylus.rhynodge.queries.HttpQuery;
this.uri = uri;
this.protocolCode = protocolCode;
this.contentType = contentType;
- this.rawResult = rawResult;
+ this.rawResult = copyOf(rawResult, rawResult.length);
}
//
* @return The raw result of the reply
*/
public byte[] rawResult() {
- return rawResult;
+ return copyOf(rawResult, rawResult.length);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return rawResult.length == 0;
}
/**
}
}
+ @Nonnull
+ @Override
+ protected String plainText() {
+ return content();
+ }
+
//
// STATIC METHODS
//