diff --git a/pom.xml b/pom.xml
index 92ed3cc..517a4da 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
io.github.jervenbolleman
handlegraph4j
- 1.1-SNAPSHOT
+ 1.1
jar
diff --git a/src/main/java/io/github/jervenbolleman/handlegraph4j/sequences/LongSequence.java b/src/main/java/io/github/jervenbolleman/handlegraph4j/sequences/LongSequence.java
index 0f4e0f9..37e36f9 100644
--- a/src/main/java/io/github/jervenbolleman/handlegraph4j/sequences/LongSequence.java
+++ b/src/main/java/io/github/jervenbolleman/handlegraph4j/sequences/LongSequence.java
@@ -165,10 +165,11 @@ private static long binaryReverseComplement(long value) {
@Override
public String toString() {
- return new String(asByteArray(), US_ASCII);
+ return new String(asAsciiBytes(), US_ASCII);
}
- private byte[] asByteArray() {
+ @Override
+ public byte[] asAsciiBytes() {
byte[] val = new byte[length()];
for (int i = 0; i < length(); i++) {
val[i] = byteAt(i);
diff --git a/src/main/java/io/github/jervenbolleman/handlegraph4j/sequences/Sequence.java b/src/main/java/io/github/jervenbolleman/handlegraph4j/sequences/Sequence.java
index 363716a..5ff829f 100644
--- a/src/main/java/io/github/jervenbolleman/handlegraph4j/sequences/Sequence.java
+++ b/src/main/java/io/github/jervenbolleman/handlegraph4j/sequences/Sequence.java
@@ -211,13 +211,21 @@ static byte complement(byte nucleotide) {
* @return the IUPAC DNA coded sequence.
*/
default String asString() {
+ return new String(asAsciiBytes(), US_ASCII);
+ }
+
+ /**
+ * Convert the Sequence object into a java byte array of ascii
+ *
+ * @return the IUPAC DNA coded sequence.
+ */
+ default byte[] asAsciiBytes() {
byte[] val = new byte[length()];
for (int i = 0; i < length(); i++) {
val[i] = byteAt(i);
}
- return new String(val, US_ASCII);
+ return val;
}
-
/**
* Test if a String contains only known IUPAC codes
*