@Test @Disabled public void testBytesPerf() { long t0 = System.currentTimeMillis(); for ( int j = 0; j < 1000; j++ ) { Asn1Buffer buffer = new Asn1Buffer(); for ( int i = 0; i < 409600; i++ ) { buffer.put( new byte[] { 0x01, ( byte ) i } ); } } long t1 = System.currentTimeMillis(); System.out.println( "Delta: " + ( t1 - t0 ) ); }
public void put( byte b ) { if ( pos == buffer.length ) { extend( 1 ); } pos++; buffer[buffer.length - pos] = b; }
Asn1Buffer { public void put( byte b ) { if ( pos == buffer.length ) { extend( 1 ); } pos++; buffer[buffer.length - pos] = b; } }
Asn1Buffer { public void put( byte b ) { if ( pos == buffer.length ) { extend( 1 ); } pos++; buffer[buffer.length - pos] = b; } Asn1Buffer(); }
Asn1Buffer { public void put( byte b ) { if ( pos == buffer.length ) { extend( 1 ); } pos++; buffer[buffer.length - pos] = b; } Asn1Buffer(); int getPos(); void setPos( int pos ); void put( byte b ); void put( byte[] bytes ); ByteBuffer getBytes(); int getSize(); void clear(); @Override String toString(); }
Asn1Buffer { public void put( byte b ) { if ( pos == buffer.length ) { extend( 1 ); } pos++; buffer[buffer.length - pos] = b; } Asn1Buffer(); int getPos(); void setPos( int pos ); void put( byte b ); void put( byte[] bytes ); ByteBuffer getBytes(); int getSize(); void clear(); @Override String toString();  }