5454 *
5555 * @author Victor Cordis ( cordis.victor at gmail.com)
5656 * @since 1.0
57- * @version 1.4.2
57+ * @version 1.4.3
5858 */
5959public class SerializableStrategy extends AbstractStrategy <Serializable >
6060 implements CompositeStrategy <Serializable > {
@@ -481,7 +481,7 @@ public void useProtocolVersion(int version) throws IOException {
481481
482482 @ Override
483483 public void write (int val ) throws IOException {
484- this .writer .write ((byte ) val );
484+ this .writer .writeByte ((byte ) val );
485485 }
486486
487487 @ Override
@@ -496,12 +496,12 @@ public void write(byte[] buf, int off, int len) throws IOException {
496496
497497 @ Override
498498 public void writeBoolean (boolean val ) throws IOException {
499- this .writer .write (val );
499+ this .writer .writeBoolean (val );
500500 }
501501
502502 @ Override
503503 public void writeByte (int val ) throws IOException {
504- this .writer .write ((byte ) val );
504+ this .writer .writeByte ((byte ) val );
505505 }
506506
507507 @ Override
@@ -511,7 +511,7 @@ public void writeBytes(String str) throws IOException {
511511
512512 @ Override
513513 public void writeChar (int val ) throws IOException {
514- this .writer .write ((char ) val );
514+ this .writer .writeChar ((char ) val );
515515 }
516516
517517 @ Override
@@ -523,7 +523,7 @@ public void writeChars(String str) throws IOException {
523523
524524 @ Override
525525 public void writeDouble (double val ) throws IOException {
526- this .writer .write (val );
526+ this .writer .writeDouble (val );
527527 }
528528
529529 @ Override
@@ -551,17 +551,17 @@ public void writeFields() throws IOException {
551551
552552 @ Override
553553 public void writeFloat (float val ) throws IOException {
554- this .writer .write (val );
554+ this .writer .writeFloat (val );
555555 }
556556
557557 @ Override
558558 public void writeInt (int val ) throws IOException {
559- this .writer .write (val );
559+ this .writer .writeInt (val );
560560 }
561561
562562 @ Override
563563 public void writeLong (long val ) throws IOException {
564- this .writer .write (val );
564+ this .writer .writeLong (val );
565565 }
566566
567567 @ Override
@@ -571,7 +571,7 @@ protected void writeObjectOverride(Object obj) throws IOException {
571571
572572 @ Override
573573 public void writeShort (int val ) throws IOException {
574- this .writer .write ((short ) val );
574+ this .writer .writeShort ((short ) val );
575575 }
576576
577577 @ Override
@@ -673,7 +673,7 @@ public void defaultReadObject() throws IOException, ClassNotFoundException {
673673
674674 @ Override
675675 public int read () throws IOException {
676- return (Integer ) this .reader .read ();
676+ return (int ) this .reader .readByte ();
677677 }
678678
679679 @ Override
@@ -685,22 +685,22 @@ public int read(byte[] buf, int off, int len) throws IOException {
685685
686686 @ Override
687687 public boolean readBoolean () throws IOException {
688- return ( Boolean ) this .reader .read ();
688+ return this .reader .readBoolean ();
689689 }
690690
691691 @ Override
692692 public byte readByte () throws IOException {
693- return ( Byte ) this .reader .read ();
693+ return this .reader .readByte ();
694694 }
695695
696696 @ Override
697697 public char readChar () throws IOException {
698- return ( Character ) this .reader .read ();
698+ return this .reader .readChar ();
699699 }
700700
701701 @ Override
702702 public double readDouble () throws IOException {
703- return ( Double ) this .reader .read ();
703+ return this .reader .readDouble ();
704704 }
705705
706706 @ Override
@@ -751,7 +751,7 @@ public GetField readFields() throws IOException, ClassNotFoundException {
751751
752752 @ Override
753753 public float readFloat () throws IOException {
754- return ( Float ) this .reader .read ();
754+ return this .reader .readFloat ();
755755 }
756756
757757 @ Override
@@ -766,12 +766,12 @@ public void readFully(byte[] buf, int off, int len) throws IOException {
766766
767767 @ Override
768768 public int readInt () throws IOException {
769- return ( Integer ) this .reader .read ();
769+ return this .reader .readInt ();
770770 }
771771
772772 @ Override
773773 public long readLong () throws IOException {
774- return ( Long ) this .reader .read ();
774+ return this .reader .readLong ();
775775 }
776776
777777 @ Override
@@ -781,7 +781,7 @@ protected Object readObjectOverride() throws IOException, ClassNotFoundException
781781
782782 @ Override
783783 public short readShort () throws IOException {
784- return ( Short ) this .reader .read ();
784+ return this .reader .readShort ();
785785 }
786786
787787 @ Override
@@ -796,12 +796,12 @@ public Object readUnshared() throws IOException, ClassNotFoundException {
796796
797797 @ Override
798798 public int readUnsignedByte () throws IOException {
799- return ( Integer ) this .reader .read ();
799+ return this .reader .readByte ();
800800 }
801801
802802 @ Override
803803 public int readUnsignedShort () throws IOException {
804- return ( Integer ) this .reader .read ();
804+ return this .reader .readShort ();
805805 }
806806
807807 @ Override
0 commit comments