@@ -53,6 +53,7 @@ private void reserve(int len) throws IOException {
5353 }
5454 }
5555
56+ @ Override
5657 public void write (byte [] b , int off , int len ) throws IOException {
5758 if (buffer == null ) {
5859 if (bufferSize < len ) {
@@ -77,6 +78,7 @@ public void write(byte[] b, int off, int len) throws IOException {
7778 }
7879 }
7980
81+ @ Override
8082 public void write (ByteBuffer bb ) throws IOException {
8183 int len = bb .remaining ();
8284 if (buffer == null ) {
@@ -102,82 +104,95 @@ public void write(ByteBuffer bb) throws IOException {
102104 }
103105 }
104106
107+ @ Override
105108 public void writeByte (byte v ) throws IOException {
106109 reserve (1 );
107110 buffer [filled ++] = v ;
108111 }
109112
113+ @ Override
110114 public void writeShort (short v ) throws IOException {
111115 reserve (2 );
112116 castByteBuffer .putShort (filled , v );
113117 filled += 2 ;
114118 }
115119
120+ @ Override
116121 public void writeInt (int v ) throws IOException {
117122 reserve (4 );
118123 castByteBuffer .putInt (filled , v );
119124 filled += 4 ;
120125 }
121126
127+ @ Override
122128 public void writeLong (long v ) throws IOException {
123129 reserve (8 );
124130 castByteBuffer .putLong (filled , v );
125131 filled += 8 ;
126132 }
127133
134+ @ Override
128135 public void writeFloat (float v ) throws IOException {
129136 reserve (4 );
130137 castByteBuffer .putFloat (filled , v );
131138 filled += 4 ;
132139 }
133140
141+ @ Override
134142 public void writeDouble (double v ) throws IOException {
135143 reserve (8 );
136144 castByteBuffer .putDouble (filled , v );
137145 filled += 8 ;
138146 }
139147
148+ @ Override
140149 public void writeByteAndByte (byte b , byte v ) throws IOException {
141150 reserve (2 );
142151 buffer [filled ++] = b ;
143152 buffer [filled ++] = v ;
144153 }
145154
155+ @ Override
146156 public void writeByteAndShort (byte b , short v ) throws IOException {
147157 reserve (3 );
148158 buffer [filled ++] = b ;
149159 castByteBuffer .putShort (filled , v );
150160 filled += 2 ;
151161 }
152162
163+ @ Override
153164 public void writeByteAndInt (byte b , int v ) throws IOException {
154165 reserve (5 );
155166 buffer [filled ++] = b ;
156167 castByteBuffer .putInt (filled , v );
157168 filled += 4 ;
158169 }
159170
171+ @ Override
160172 public void writeByteAndLong (byte b , long v ) throws IOException {
161173 reserve (9 );
162174 buffer [filled ++] = b ;
163175 castByteBuffer .putLong (filled , v );
164176 filled += 8 ;
165177 }
166178
179+ @ Override
167180 public void writeByteAndFloat (byte b , float v ) throws IOException {
168181 reserve (5 );
169182 buffer [filled ++] = b ;
170183 castByteBuffer .putFloat (filled , v );
171184 filled += 4 ;
172185 }
173186
187+ @ Override
174188 public void writeByteAndDouble (byte b , double v ) throws IOException {
175189 reserve (9 );
176190 buffer [filled ++] = b ;
177191 castByteBuffer .putDouble (filled , v );
178192 filled += 8 ;
179193 }
180194
195+ @ Override
181196 public void flush () throws IOException {
182197 if (filled > 0 ) {
183198 if (!flushBuffer (buffer , 0 , filled )) {
0 commit comments