MCPcopy Create free account
hub / github.com/careercup/ctci / encode

Method encode

java/Chapter 17/Question17_10/QuestionString.java:19–28  ·  view source on GitHub ↗
(char[] input)

Source from the content-addressed store, hash-verified

17 public QuestionString(Map<String, Byte> tagMap) {this.tagMap = tagMap;}
18
19 public byte[] encode(char[] input) throws IOException {
20 // tokenize
21 tokenize(input);
22 currentTokenIndex = 0;
23
24 // parse
25 ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
26 encodeTokens(outputStream);
27 return outputStream.toByteArray();
28 }
29
30 private void encodeTokens(ByteArrayOutputStream output)
31 throws IOException {

Callers 1

mainMethod · 0.95

Calls 2

tokenizeMethod · 0.95
encodeTokensMethod · 0.95

Tested by

no test coverage detected