@ -1348,15 +1348,16 @@ public abstract class CodedOutputStream extends ByteOutput {
public final void writeFixed32NoTag ( int value ) throws IOException {
public final void writeFixed32NoTag ( int value ) throws IOException {
int position = this . position ; // Perf: hoist field to register to avoid load/stores.
int position = this . position ; // Perf: hoist field to register to avoid load/stores.
try {
try {
buffer [ position + + ] = ( byte ) ( value & 0xFF ) ;
buffer [ position ] = ( byte ) ( value & 0xFF ) ;
buffer [ position + + ] = ( byte ) ( ( value > > 8 ) & 0xFF ) ;
buffer [ position + 1 ] = ( byte ) ( ( value > > 8 ) & 0xFF ) ;
buffer [ position + + ] = ( byte ) ( ( value > > 16 ) & 0xFF ) ;
buffer [ position + 2 ] = ( byte ) ( ( value > > 16 ) & 0xFF ) ;
buffer [ position + + ] = ( byte ) ( ( value > > 24 ) & 0xFF ) ;
buffer [ position + 3 ] = ( byte ) ( ( value > > 24 ) & 0xFF ) ;
} catch ( IndexOutOfBoundsException e ) {
} catch ( IndexOutOfBoundsException e ) {
throw new OutOfSpaceException (
throw new OutOfSpaceException (
String . format ( "Pos: %d, limit: %d, len: %d" , position , limit , 1 ) , e ) ;
String . format ( "Pos: %d, limit: %d, len: %d" , position , limit , FIXED32_SIZE ) , e ) ;
}
}
this . position = position ; // Only update position if we stayed within the array bounds.
// Only update position if we stayed within the array bounds.
this . position = position + FIXED32_SIZE ;
}
}
@Override
@Override
@ -1393,19 +1394,20 @@ public abstract class CodedOutputStream extends ByteOutput {
public final void writeFixed64NoTag ( long value ) throws IOException {
public final void writeFixed64NoTag ( long value ) throws IOException {
int position = this . position ; // Perf: hoist field to register to avoid load/stores.
int position = this . position ; // Perf: hoist field to register to avoid load/stores.
try {
try {
buffer [ position + + ] = ( byte ) ( ( int ) ( value ) & 0xFF ) ;
buffer [ position ] = ( byte ) ( ( int ) ( value ) & 0xFF ) ;
buffer [ position + + ] = ( byte ) ( ( int ) ( value > > 8 ) & 0xFF ) ;
buffer [ position + 1 ] = ( byte ) ( ( int ) ( value > > 8 ) & 0xFF ) ;
buffer [ position + + ] = ( byte ) ( ( int ) ( value > > 16 ) & 0xFF ) ;
buffer [ position + 2 ] = ( byte ) ( ( int ) ( value > > 16 ) & 0xFF ) ;
buffer [ position + + ] = ( byte ) ( ( int ) ( value > > 24 ) & 0xFF ) ;
buffer [ position + 3 ] = ( byte ) ( ( int ) ( value > > 24 ) & 0xFF ) ;
buffer [ position + + ] = ( byte ) ( ( int ) ( value > > 32 ) & 0xFF ) ;
buffer [ position + 4 ] = ( byte ) ( ( int ) ( value > > 32 ) & 0xFF ) ;
buffer [ position + + ] = ( byte ) ( ( int ) ( value > > 40 ) & 0xFF ) ;
buffer [ position + 5 ] = ( byte ) ( ( int ) ( value > > 40 ) & 0xFF ) ;
buffer [ position + + ] = ( byte ) ( ( int ) ( value > > 48 ) & 0xFF ) ;
buffer [ position + 6 ] = ( byte ) ( ( int ) ( value > > 48 ) & 0xFF ) ;
buffer [ position + + ] = ( byte ) ( ( int ) ( value > > 56 ) & 0xFF ) ;
buffer [ position + 7 ] = ( byte ) ( ( int ) ( value > > 56 ) & 0xFF ) ;
} catch ( IndexOutOfBoundsException e ) {
} catch ( IndexOutOfBoundsException e ) {
throw new OutOfSpaceException (
throw new OutOfSpaceException (
String . format ( "Pos: %d, limit: %d, len: %d" , position , limit , 1 ) , e ) ;
String . format ( "Pos: %d, limit: %d, len: %d" , position , limit , FIXED64_SIZE ) , e ) ;
}
}
this . position = position ; // Only update position if we stayed within the array bounds.
// Only update position if we stayed within the array bounds.
this . position = position + FIXED64_SIZE ;
}
}
@Override
@Override