/** * {@inheritDoc} */ @Override public void putChar(char c) { prepareForAccess(2); if (componentCursor.getRemaining() >= 4) { componentCursor.putChar(c); index += 2; } else { byte b0; byte b1; if (order.equals(ByteOrder.BIG_ENDIAN)) { b0 = (byte) ((c >> 8) & 0xff); b1 = (byte) (c & 0xff); } else { b0 = (byte) (c & 0xff); b1 = (byte) ((c >> 8) & 0xff); } put(b0); put(b1); } }
/** * {@inheritDoc} */ @Override public void putChar(char c) { prepareForAccess(2); if (componentCursor.getRemaining() >= 4) { componentCursor.putChar(c); index += 2; } else { byte b0; byte b1; if (order.equals(ByteOrder.BIG_ENDIAN)) { b0 = (byte) ((c >> 8) & 0xff); b1 = (byte) (c & 0xff); } else { b0 = (byte) (c & 0xff); b1 = (byte) ((c >> 8) & 0xff); } put(b0); put(b1); } }
/** * @inheritDoc */ public void putShort( short s ) { prepareForAccess( 2 ); if ( componentCursor.getRemaining() >= 4 ) { componentCursor.putShort( s ); index += 2; } else { byte b0; byte b1; if ( order.equals( ByteOrder.BIG_ENDIAN ) ) { b0 = ( byte ) ( ( s >> 8 ) & 0xff ); b1 = ( byte ) ( ( s >> 0 ) & 0xff ); } else { b0 = ( byte ) ( ( s >> 0 ) & 0xff ); b1 = ( byte ) ( ( s >> 8 ) & 0xff ); } put( b0 ); put( b1 ); } }
} else { if (order.equals(ByteOrder.BIG_ENDIAN)) { put((byte) ((l >> 56) & 0xff)); put((byte) ((l >> 48) & 0xff)); put((byte) ((l >> 40) & 0xff)); put((byte) ((l >> 32) & 0xff)); put((byte) ((l >> 24) & 0xff)); put((byte) ((l >> 16) & 0xff)); put((byte) ((l >> 8) & 0xff)); put((byte) (l & 0xff)); } else { put((byte) (l & 0xff)); put((byte) ((l >> 8) & 0xff)); put((byte) ((l >> 16) & 0xff)); put((byte) ((l >> 24) & 0xff)); put((byte) ((l >> 32) & 0xff)); put((byte) ((l >> 40) & 0xff)); put((byte) ((l >> 48) & 0xff)); put((byte) ((l >> 56) & 0xff));
/** * @inheritDoc */ public void putChar( char c ) { prepareForAccess( 2 ); if ( componentCursor.getRemaining() >= 4 ) { componentCursor.putChar( c ); index += 2; } else { byte b0; byte b1; if ( order.equals( ByteOrder.BIG_ENDIAN ) ) { b0 = ( byte ) ( ( c >> 8 ) & 0xff ); b1 = ( byte ) ( ( c >> 0 ) & 0xff ); } else { b0 = ( byte ) ( ( c >> 0 ) & 0xff ); b1 = ( byte ) ( ( c >> 8 ) & 0xff ); } put( b0 ); put( b1 ); } }
} else { if (order.equals(ByteOrder.BIG_ENDIAN)) { put((byte) ((l >> 56) & 0xff)); put((byte) ((l >> 48) & 0xff)); put((byte) ((l >> 40) & 0xff)); put((byte) ((l >> 32) & 0xff)); put((byte) ((l >> 24) & 0xff)); put((byte) ((l >> 16) & 0xff)); put((byte) ((l >> 8) & 0xff)); put((byte) (l & 0xff)); } else { put((byte) (l & 0xff)); put((byte) ((l >> 8) & 0xff)); put((byte) ((l >> 16) & 0xff)); put((byte) ((l >> 24) & 0xff)); put((byte) ((l >> 32) & 0xff)); put((byte) ((l >> 40) & 0xff)); put((byte) ((l >> 48) & 0xff)); put((byte) ((l >> 56) & 0xff));
/** * {@inheritDoc} */ @Override public void putInt(int i) { prepareForAccess(4); if (componentCursor.getRemaining() >= 4) { componentCursor.putInt(i); index += 4; } else { if (order.equals(ByteOrder.BIG_ENDIAN)) { put((byte) ((i >> 24) & 0xff)); put((byte) ((i >> 16) & 0xff)); put((byte) ((i >> 8) & 0xff)); put((byte) (i & 0xff)); } else { put((byte) (i & 0xff)); put((byte) ((i >> 8) & 0xff)); put((byte) ((i >> 16) & 0xff)); put((byte) ((i >> 24) & 0xff)); } } }
/** * {@inheritDoc} */ @Override public void putInt(int i) { prepareForAccess(4); if (componentCursor.getRemaining() >= 4) { componentCursor.putInt(i); index += 4; } else { if (order.equals(ByteOrder.BIG_ENDIAN)) { put((byte) ((i >> 24) & 0xff)); put((byte) ((i >> 16) & 0xff)); put((byte) ((i >> 8) & 0xff)); put((byte) (i & 0xff)); } else { put((byte) (i & 0xff)); put((byte) ((i >> 8) & 0xff)); put((byte) ((i >> 16) & 0xff)); put((byte) ((i >> 24) & 0xff)); } } }
/** * {@inheritDoc} */ @Override public void putShort(short s) { prepareForAccess(2); if (componentCursor.getRemaining() >= 4) { componentCursor.putShort(s); index += 2; } else { if (order.equals(ByteOrder.BIG_ENDIAN)) { put((byte) ((s >> 8) & 0xff)); put((byte) (s & 0xff)); } else { put((byte) (s & 0xff)); put((byte) ((s >> 8) & 0xff)); } } }
/** * {@inheritDoc} */ @Override public void putShort(short s) { prepareForAccess(2); if (componentCursor.getRemaining() >= 4) { componentCursor.putShort(s); index += 2; } else { if (order.equals(ByteOrder.BIG_ENDIAN)) { put((byte) ((s >> 8) & 0xff)); put((byte) (s & 0xff)); } else { put((byte) (s & 0xff)); put((byte) ((s >> 8) & 0xff)); } } }