code: private static Object getObjectOfType(IoBufferEx buffer, AmqpType type) 
             throws ProtocolDecoderException {
          Object value;
          switch (type)
          {
              case BIT:
                  value = getBit(buffer);
                  break;
              case SHORTSTRING:
                  value = getShortString(buffer);
                  break;
              case LONGSTRING:
                  value = getLongString(buffer);
                  break;
              case FIELDTABLE:
                  value = getFieldTable(buffer);
                  break;
              case TABLE:                
                  value = getTable(buffer);
                  break;
              case INT:
                  value = buffer.getInt();
                  break;
              case UNSIGNEDINT:
                  value = getUnsignedInt(buffer);
                  break;
              case UNSIGNEDSHORT:
                  value = getUnsignedShort(buffer);
                  break;
              case UNSIGNED:                
                  value = buffer.getUnsigned();
                  break;
              case SHORT:
                  value = getUnsignedShort(buffer);
                  break;
              case LONG:
                  value = getUnsignedInt(buffer);
                  break;
              case OCTET:                
                  value = buffer.getUnsigned();
                  break;
              case LONGLONG:
                  value = getUnsignedLong(buffer);
                  break;
              case TIMESTAMP:
                  long millis = getMilliseconds(buffer);
                  value = new Timestamp(millis);
                  break;
              case VOID:
                  value = null;
                  break;
              default:
                  String s = "Invalid type: '" + type;
                  throw new ProtocolDecoderException(s);
          }
          return value;
      }
docs: /*
  private FrameHeader getFrameHeader()
  {
  int frameType = this.getUnsigned();
  int channel = this.getUnsignedShort();
  long size =  this.getUnsignedInt();
  
  FrameHeader header = new FrameHeader();
  header.frameType = frameType;
  header.size = size;
  header.channel = channel;
  
  return header;
  }