protected void testOptimalEncoding( Number v, byte optimalEncoding ) {
		try {
			ByteArrayOutputStream baos = new ByteArrayOutputStream();
			StandardValueOps.writeNumberCompact(v, baos);
			byte[] encoded = baos.toByteArray();
			if( optimalEncoding == StandardValueOps.NE_INT6 ) {
				assertEquals(1, encoded.length);
				assertEquals(v.intValue(), encoded[0]);
			} else {
				assertEquals(optimalEncoding, encoded[0]);
			}
			// rather than storing a proper header full of imports,
			// we'll cheat a little bit, here.
			OpcodeBehavior[] opcodeBehavior = Opcodes.createInitialOpcodeTable();
			for( int i=0; i<StandardValueOps.STANDARD_OPS.length; ++i ) {
				if( StandardValueOps.STANDARD_OPS[i] != null ) {
					opcodeBehavior[i] = StandardValueOps.STANDARD_OPS[i];
				}
			}
			DecodeState ds = new DecodeState(opcodeBehavior);
			ds.process(encoded, 0, encoded.length, null);
			if( v instanceof Double || v instanceof Float ) {
				assertEquals( v.doubleValue(), ((Number)ds.getValue()).doubleValue() );
			} else {
				assertEquals( v.longValue(), ((Number)ds.getValue()).longValue() );
			}
		} catch( IOException e ) {
			throw new RuntimeException(e);
		} catch( InvalidEncoding e ) {
			throw new RuntimeException(e);
		} catch( ResourceNotFound e ) {
			throw new RuntimeException(e);
		}
	}