public void put(String key,Object value,boolean errorOnFail){
  if (value == null) {
    putNull(key);
  }
 else   if (value instanceof Boolean) {
    put(key,(Boolean)value);
  }
 else   if (value instanceof Byte) {
    put(key,(Byte)value);
  }
 else   if (value instanceof Double) {
    put(key,(Double)value);
  }
 else   if (value instanceof Float) {
    put(key,(Float)value);
  }
 else   if (value instanceof Integer) {
    put(key,(Integer)value);
  }
 else   if (value instanceof Long) {
    put(key,(Long)value);
  }
 else   if (value instanceof Short) {
    put(key,(Short)value);
  }
 else   if (value instanceof String) {
    put(key,(String)value);
  }
 else   if (value instanceof byte[]) {
    put(key,(byte[])value);
  }
 else   if (errorOnFail) {
    throw new UnsupportedOperationException("Could not handle type " + value.getClass());
  }
}

public void put ( String key , Object value , boolean errorOnFail ) { if ( value == null ) { putNull ( key ) ; } else if ( value instanceof Boolean ) { put ( key , ( Boolean ) value ) ; } else if ( value instanceof Byte ) { put ( key , ( Byte ) value ) ; } else if ( value instanceof Double ) { put ( key , ( Double ) value ) ; } else if ( value instanceof Float ) { put ( key , ( Float ) value ) ; } else if ( value instanceof Integer ) { put ( key , ( Integer ) value ) ; } else if ( value instanceof Long ) { put ( key , ( Long ) value ) ; } else if ( value instanceof Short ) { put ( key , ( Short ) value ) ; } else if ( value instanceof String ) { put ( key , ( String ) value ) ; } else if ( value instanceof byte [ ] ) { put ( key , ( byte [ ] ) value ) ; } else if ( errorOnFail ) { throw new UnsupportedOperationException ( "Could not handle type " + value . getClass ( ) ) ; } }
add a value of unknown type to the set if it is one of the accepted types . accepted types are any primitive ( integer , boolean , etc . ) , string , and byte [ ] .
