summaryrefslogtreecommitdiffstats
path: root/src/net/gcdc/asn1/uper/BitBuffer.java
diff options
context:
space:
mode:
authorCGantert345 <57003061+CGantert345@users.noreply.github.com>2020-01-03 10:37:01 +0100
committerGitHub <noreply@github.com>2020-01-03 10:37:01 +0100
commit46039355e87825a9dce12ebaad0305d20eea3f43 (patch)
tree6b17c400a9b98d2a6ec367deeea9597ac2c78e5b /src/net/gcdc/asn1/uper/BitBuffer.java
parentlogging (diff)
downloadUIC-barcode-46039355e87825a9dce12ebaad0305d20eea3f43.tar
UIC-barcode-46039355e87825a9dce12ebaad0305d20eea3f43.tar.gz
UIC-barcode-46039355e87825a9dce12ebaad0305d20eea3f43.tar.bz2
UIC-barcode-46039355e87825a9dce12ebaad0305d20eea3f43.tar.lz
UIC-barcode-46039355e87825a9dce12ebaad0305d20eea3f43.tar.xz
UIC-barcode-46039355e87825a9dce12ebaad0305d20eea3f43.tar.zst
UIC-barcode-46039355e87825a9dce12ebaad0305d20eea3f43.zip
Diffstat (limited to 'src/net/gcdc/asn1/uper/BitBuffer.java')
-rw-r--r--src/net/gcdc/asn1/uper/BitBuffer.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/net/gcdc/asn1/uper/BitBuffer.java b/src/net/gcdc/asn1/uper/BitBuffer.java
new file mode 100644
index 0000000..948dda5
--- /dev/null
+++ b/src/net/gcdc/asn1/uper/BitBuffer.java
@@ -0,0 +1,32 @@
+package net.gcdc.asn1.uper;
+
+/**
+ * An interface for convenient storage of bits, similar to Java's ByteBuffer.
+ *
+ * This interface and its implementation are very useful for UPER, since UPER operates on bits
+ * regardless of byte boundaries.
+ *
+ */
+public interface BitBuffer {
+ boolean get();
+ boolean get(int index);
+ BitBuffer put(boolean element);
+ BitBuffer put(int index, boolean element);
+ int limit();
+ int capacity();
+ int position();
+ int remaining();
+ BitBuffer flip();
+ String toBooleanString(int startIndex, int length);
+ String toBooleanStringFromPosition(int startIndex);
+ byte[] array();
+ BitBuffer putByte(byte element);
+ byte getByte();
+ void putInteger(int index, int length,int number);
+ void putChar6String(int index, int length, String s);
+ int getInteger(int index, int length);
+ String getChar6String(int position, int length);
+ void putChar5String(int index, int length, String s);
+ String getChar5String(int inxed, int length);
+ BitBuffer putByteArray(int index, byte[] data);
+}