OLD | NEW |
1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
4 // | 4 // |
5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
7 // met: | 7 // met: |
8 // | 8 // |
9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 right.writeToInternal(out, 0, numberToWrite - numberToWriteInLeft); | 399 right.writeToInternal(out, 0, numberToWrite - numberToWriteInLeft); |
400 } | 400 } |
401 } | 401 } |
402 | 402 |
403 @Override | 403 @Override |
404 void writeTo(ByteOutput output) throws IOException { | 404 void writeTo(ByteOutput output) throws IOException { |
405 left.writeTo(output); | 405 left.writeTo(output); |
406 right.writeTo(output); | 406 right.writeTo(output); |
407 } | 407 } |
408 | 408 |
409 | |
410 @Override | 409 @Override |
411 protected String toStringInternal(Charset charset) { | 410 protected String toStringInternal(Charset charset) { |
412 return new String(toByteArray(), charset); | 411 return new String(toByteArray(), charset); |
413 } | 412 } |
414 | 413 |
415 // ================================================================= | 414 // ================================================================= |
416 // UTF-8 decoding | 415 // UTF-8 decoding |
417 | 416 |
418 @Override | 417 @Override |
419 public boolean isValidUtf8() { | 418 public boolean isValidUtf8() { |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 currentPiece = pieceIterator.next(); | 887 currentPiece = pieceIterator.next(); |
889 currentPieceSize = currentPiece.size(); | 888 currentPieceSize = currentPiece.size(); |
890 } else { | 889 } else { |
891 currentPiece = null; | 890 currentPiece = null; |
892 currentPieceSize = 0; | 891 currentPieceSize = 0; |
893 } | 892 } |
894 } | 893 } |
895 } | 894 } |
896 } | 895 } |
897 } | 896 } |
OLD | NEW |