Last active
May 9, 2017 13:52
-
-
Save MattOates/363ce81f463f643709e5c69b4e641f38 to your computer and use it in GitHub Desktop.
Add in a new decoding for Blob/Buf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my class 2bit does Blob[uint8] is repr('VMArray') { | |
method decode(2bit:D: $encoding = '2bit') { | |
die "Can not decode a 2bit buffer as if it were $encoding" | |
unless $enc eq '2bit'; | |
#TODO the guts here | |
} | |
method encoding() { '2bit' } | |
multi method Str(2bit:D:) { self.decode } | |
multi method Stringy(2bit:D:) { self.decode } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment