diff --git a/encoding/ucs2.go b/encoding/ucs2.go index 9ec252f..34883fb 100644 --- a/encoding/ucs2.go +++ b/encoding/ucs2.go @@ -4,10 +4,16 @@ import "bytes" type UCS2Coder struct{} -func (c *UCS2Coder) Encode(s string, buf *bytes.Buffer) { +func (c *UCS2Coder) Encode(s *string, buf *bytes.Buffer) error { + panic("UCS2 not implemented yet") +} +func (c *UCS2Coder) Decode(buf *bytes.Buffer) (string, error) { panic("UCS2 not implemented yet") } -func (c *UCS2Coder) Decode(buf *bytes.Buffer) string { - panic("UCS2 not implemented yet") +func (c UCS2Coder) EncodesInto(s *string) int { + return len(*s) * 2 +} +func (c UCS2Coder) DecodesInto(buf *bytes.Buffer) int { + return buf.Len() / 2 }