Subversion Repository Public Repository

litesoft

Diff Revisions 852 vs 853 for /trunk/Java/core/Anywhere/src/org/litesoft/codec/StringTypedTerminatingCodec.java

Diff revisions: vs.
  @@ -14,27 +14,13 @@
14 14 @Override
15 15 protected @NotNull void encodeNonNull( CharSink pCharSink, String pValue )
16 16 {
17 - IntegerTypedTerminatingCodec.NON_NEGATIVE.encode( pCharSink, pValue.length() );
18 - for ( int i = 0; i < pValue.length(); i++ )
19 - {
20 - pCharSink.add( pValue.charAt( i ) );
21 - }
17 + NonNullStringTerminatingCodec.INSTANCE.encode( pCharSink, pValue );
22 18 }
23 19
24 20 @Override
25 21 protected @NotNull String decodeNonNull( CharSource pCharSource )
26 22 {
27 - int zLength = IntegerTypedTerminatingCodec.NON_NEGATIVE.decode( pCharSource );
28 - if ( zLength == 0 )
29 - {
30 - return "";
31 - }
32 - StringBuilder zSB = new StringBuilder( zLength );
33 - while ( zLength-- > 0 )
34 - {
35 - zSB.append( pCharSource.getRequired() );
36 - }
37 - return zSB.toString();
23 + return NonNullStringTerminatingCodec.INSTANCE.decode( pCharSource );
38 24 }
39 25 }
40 26