static Value decode(byte type, ByteBuffer src) {
        switch (type) {
        case INT8:         return new Int8Value(src);
        case INT8_ARRAY:   return new Int8Array(src);
        case INT16:        return new Int16Value(src);
        case INT16_ARRAY:  return new Int16Array(src);
        case INT32:        return new Int32Value(src);
        case INT32_ARRAY:  return new Int32Array(src);
        case INT64:        return new Int64Value(src);
        case INT64_ARRAY:  return new Int64Array(src);
        case FLOAT:        return new FloatValue(src);
        case FLOAT_ARRAY:  return new FloatArray(src);
        case DOUBLE:       return new DoubleValue(src);
        case DOUBLE_ARRAY: return new DoubleArray(src);
        case STRING:       return new StringValue(src);
        case STRING_ARRAY: return new StringArray(src);
        case DATA:         return new DataValue(src);
        case DATA_ARRAY:   return new DataArray(src);
        }
        throw new IllegalArgumentException();
    }
Decode a value from the given buffer. This method also acts as
a factory for value objects

@return the decoded value
@param type value type identifier
@param src where the value is stored
@throws IllegalArgumentException if the given type identifier is illegal
jrt/src/com/yahoo/jrt/Value.java