docs: public static void appendAsString(
          final StringBuilder sb, final DirectBuffer buffer, final int index, final Encoding encoding)
      {
          switch (encoding.primitiveType())
          {
              case CHAR:
                  sb.append('\'').append((char)buffer.getByte(index)).append('\'');
                  break;
  
              case INT8:
                  sb.append(buffer.getByte(index));
                  break;
  
              case INT16:
                  sb.append(buffer.getShort(index, encoding.byteOrder()));
                  break;
  
              case INT32:
                  sb.append(buffer.getInt(index, encoding.byteOrder()));
                  break;
  
              case INT64:
                  sb.append(buffer.getLong(index, encoding.byteOrder()));
                  break;
  
              case UINT8:
                  sb.append((short)(buffer.getByte(index) & 0xFF));
                  break;
  
              case UINT16:
                  sb.append(buffer.getShort(index, encoding.byteOrder()) & 0xFFFF);
                  break;
  
              case UINT32:
                  sb.append(buffer.getInt(index, encoding.byteOrder()) & 0xFFFF_FFFFL);
                  break;
  
              case UINT64:
                  sb.append(buffer.getLong(index, encoding.byteOrder()));
                  break;
  
              case FLOAT:
                  sb.append(buffer.getFloat(index, encoding.byteOrder()));
                  break;
  
              case DOUBLE:
                  sb.append(buffer.getDouble(index, encoding.byteOrder()));
                  break;
          }
      }