code: function readHead(type, buf) {
    var tap = new Tap(buf);
    var head = type._read(tap);
    if (!tap.isValid()) {
      throw new Error(f('truncated %j', type.schema()));
    }
    return {head: head, tail: tap.buf.slice(tap.pos)};
  }
docs: Decode a type used as prefix inside a buffer.
  
  @param type {Type} The type of the prefix.
  @param buf {Buffer} Encoded bytes.
  
  This function will return an object `{head, tail}` where head contains the
  decoded value and tail the rest of the buffer. An error will be thrown if
  the prefix cannot be decoded.