code: public byte[] encode() throws IOException {
          final ByteBuffer buf = ByteBuffer.allocate(totalSize());
          log.debug("Tag: " + this);
          buf.put(id.encode());
          buf.put(size.encode());
          putValue(buf);
          buf.flip();
          return buf.array();
      }
docs: method to encode {@link Tag} as sequence of bytes
  
  @return - encoded {@link Tag}
  @throws IOException
  - in case of any IO errors