1 package byteio 2 3 // File automatically generated with ./gen.sh. 4 5 // StickyReader will wrap an EndianReader and count all byte handled and errors 6 // received. 7 // Byte counts and errors will not be returned from any method (except Read so 8 // it still counts as an io.Reader), but can be retrieved from this type. 9 // All methods will be a no-op after an error has been returned, returning 0, 10 // unless that error is cleared on the type. 11 type StickyReader struct { 12 Reader EndianReader 13 Err error 14 Count int64 15 } 16 17 // GetCount returns any error received. 18 func (s *StickyReader) GetError() error { 19 return s.Err 20 } 21 22 // GetCount returns the number of bytes read. 23 func (s *StickyReader) GetCount() int64 { 24 return s.Count 25 } 26 27 // Read will do a simple byte read from the underlying io.Reader. 28 func (s *StickyReader) Read(b []byte) (int, error) { 29 if s.Err != nil { 30 return 0, s.Err 31 } 32 33 n, err := s.Reader.Read(b) 34 s.Err = err 35 s.Count += int64(n) 36 37 return n, err 38 } 39 40 // Read will Read a byte read with the underlying io.Reader. 41 func (s *StickyReader) ReadByte() (byte, error) { 42 if s.Err != nil { 43 return 0, s.Err 44 } 45 46 b, err := s.Reader.ReadByte() 47 s.Err = err 48 s.Count++ 49 50 return b, err 51 } 52 53 // Read will Read a boolean with the underlying io.Reader. 54 func (s *StickyReader) ReadBool() bool { 55 if s.Err != nil { 56 return false 57 } 58 59 b, n, err := s.Reader.ReadBool() 60 s.Err = err 61 s.Count += int64(n) 62 63 return b 64 } 65 66 // ReadInt8 will read a int8 using the underlying reader. 67 func (s *StickyReader) ReadInt8() int8 { 68 if s.Err != nil { 69 return 0 70 } 71 72 i, n, err := s.Reader.ReadInt8() 73 s.Err = err 74 s.Count += int64(n) 75 76 return i 77 } 78 79 // ReadInt16 will read a int16 using the underlying reader. 80 func (s *StickyReader) ReadInt16() int16 { 81 if s.Err != nil { 82 return 0 83 } 84 85 i, n, err := s.Reader.ReadInt16() 86 s.Err = err 87 s.Count += int64(n) 88 89 return i 90 } 91 92 // ReadInt24 will read a int24 using the underlying reader. 93 func (s *StickyReader) ReadInt24() int32 { 94 if s.Err != nil { 95 return 0 96 } 97 98 i, n, err := s.Reader.ReadInt24() 99 s.Err = err 100 s.Count += int64(n) 101 102 return i 103 } 104 105 // ReadInt32 will read a int32 using the underlying reader. 106 func (s *StickyReader) ReadInt32() int32 { 107 if s.Err != nil { 108 return 0 109 } 110 111 i, n, err := s.Reader.ReadInt32() 112 s.Err = err 113 s.Count += int64(n) 114 115 return i 116 } 117 118 // ReadInt40 will read a int40 using the underlying reader. 119 func (s *StickyReader) ReadInt40() int64 { 120 if s.Err != nil { 121 return 0 122 } 123 124 i, n, err := s.Reader.ReadInt40() 125 s.Err = err 126 s.Count += int64(n) 127 128 return i 129 } 130 131 // ReadInt48 will read a int48 using the underlying reader. 132 func (s *StickyReader) ReadInt48() int64 { 133 if s.Err != nil { 134 return 0 135 } 136 137 i, n, err := s.Reader.ReadInt48() 138 s.Err = err 139 s.Count += int64(n) 140 141 return i 142 } 143 144 // ReadInt56 will read a int56 using the underlying reader. 145 func (s *StickyReader) ReadInt56() int64 { 146 if s.Err != nil { 147 return 0 148 } 149 150 i, n, err := s.Reader.ReadInt56() 151 s.Err = err 152 s.Count += int64(n) 153 154 return i 155 } 156 157 // ReadInt64 will read a int64 using the underlying reader. 158 func (s *StickyReader) ReadInt64() int64 { 159 if s.Err != nil { 160 return 0 161 } 162 163 i, n, err := s.Reader.ReadInt64() 164 s.Err = err 165 s.Count += int64(n) 166 167 return i 168 } 169 170 // ReadUint8 will read a uint8 using the underlying reader. 171 func (s *StickyReader) ReadUint8() uint8 { 172 if s.Err != nil { 173 return 0 174 } 175 176 i, n, err := s.Reader.ReadUint8() 177 s.Err = err 178 s.Count += int64(n) 179 180 return i 181 } 182 183 // ReadUint16 will read a uint16 using the underlying reader. 184 func (s *StickyReader) ReadUint16() uint16 { 185 if s.Err != nil { 186 return 0 187 } 188 189 i, n, err := s.Reader.ReadUint16() 190 s.Err = err 191 s.Count += int64(n) 192 193 return i 194 } 195 196 // ReadUint24 will read a uint24 using the underlying reader. 197 func (s *StickyReader) ReadUint24() uint32 { 198 if s.Err != nil { 199 return 0 200 } 201 202 i, n, err := s.Reader.ReadUint24() 203 s.Err = err 204 s.Count += int64(n) 205 206 return i 207 } 208 209 // ReadUint32 will read a uint32 using the underlying reader. 210 func (s *StickyReader) ReadUint32() uint32 { 211 if s.Err != nil { 212 return 0 213 } 214 215 i, n, err := s.Reader.ReadUint32() 216 s.Err = err 217 s.Count += int64(n) 218 219 return i 220 } 221 222 // ReadUint40 will read a uint40 using the underlying reader. 223 func (s *StickyReader) ReadUint40() uint64 { 224 if s.Err != nil { 225 return 0 226 } 227 228 i, n, err := s.Reader.ReadUint40() 229 s.Err = err 230 s.Count += int64(n) 231 232 return i 233 } 234 235 // ReadUint48 will read a uint48 using the underlying reader. 236 func (s *StickyReader) ReadUint48() uint64 { 237 if s.Err != nil { 238 return 0 239 } 240 241 i, n, err := s.Reader.ReadUint48() 242 s.Err = err 243 s.Count += int64(n) 244 245 return i 246 } 247 248 // ReadUint56 will read a uint56 using the underlying reader. 249 func (s *StickyReader) ReadUint56() uint64 { 250 if s.Err != nil { 251 return 0 252 } 253 254 i, n, err := s.Reader.ReadUint56() 255 s.Err = err 256 s.Count += int64(n) 257 258 return i 259 } 260 261 // ReadUint64 will read a uint64 using the underlying reader. 262 func (s *StickyReader) ReadUint64() uint64 { 263 if s.Err != nil { 264 return 0 265 } 266 267 i, n, err := s.Reader.ReadUint64() 268 s.Err = err 269 s.Count += int64(n) 270 271 return i 272 } 273 274 // ReadFloat32 will read a float32 using the underlying reader. 275 func (s *StickyReader) ReadFloat32() float32 { 276 if s.Err != nil { 277 return 0 278 } 279 280 i, n, err := s.Reader.ReadFloat32() 281 s.Err = err 282 s.Count += int64(n) 283 284 return i 285 } 286 287 // ReadFloat64 will read a float64 using the underlying reader. 288 func (s *StickyReader) ReadFloat64() float64 { 289 if s.Err != nil { 290 return 0 291 } 292 293 i, n, err := s.Reader.ReadFloat64() 294 s.Err = err 295 s.Count += int64(n) 296 297 return i 298 } 299 300 // ReadIntX will read a 64-bit var-int using the underlying ReadIntX method. 301 func (s *StickyReader) ReadIntX() int64 { 302 if s.Err != nil { 303 return 0 304 } 305 306 i, n, err := s.Reader.ReadIntX() 307 s.Err = err 308 s.Count += int64(n) 309 310 return i 311 } 312 313 // ReadUintX will read a 64-bit var-uint using the underlying ReadUintX method. 314 func (s *StickyReader) ReadUintX() uint64 { 315 if s.Err != nil { 316 return 0 317 } 318 319 i, n, err := s.Reader.ReadUintX() 320 s.Err = err 321 s.Count += int64(n) 322 323 return i 324 } 325 326 // ReadBytes will read a bytes using the underlying ReadBytes method. 327 func (s *StickyReader) ReadBytes(p int) []byte { 328 if s.Err != nil { 329 return nil 330 } 331 332 r, n, err := s.Reader.ReadBytes(p) 333 s.Err = err 334 s.Count += int64(n) 335 336 return r 337 } 338 339 // ReadBytesX will read a bytes using the underlying ReadBytesX method. 340 func (s *StickyReader) ReadBytesX() []byte { 341 if s.Err != nil { 342 return nil 343 } 344 345 r, n, err := s.Reader.ReadBytesX() 346 s.Err = err 347 s.Count += int64(n) 348 349 return r 350 } 351 352 // ReadBytes8 will read a bytes using the underlying ReadBytes8 method. 353 func (s *StickyReader) ReadBytes8() []byte { 354 if s.Err != nil { 355 return nil 356 } 357 358 r, n, err := s.Reader.ReadBytes8() 359 s.Err = err 360 s.Count += int64(n) 361 362 return r 363 } 364 365 // ReadBytes16 will read a bytes using the underlying ReadBytes16 method. 366 func (s *StickyReader) ReadBytes16() []byte { 367 if s.Err != nil { 368 return nil 369 } 370 371 r, n, err := s.Reader.ReadBytes16() 372 s.Err = err 373 s.Count += int64(n) 374 375 return r 376 } 377 378 // ReadBytes24 will read a bytes using the underlying ReadBytes24 method. 379 func (s *StickyReader) ReadBytes24() []byte { 380 if s.Err != nil { 381 return nil 382 } 383 384 r, n, err := s.Reader.ReadBytes24() 385 s.Err = err 386 s.Count += int64(n) 387 388 return r 389 } 390 391 // ReadBytes32 will read a bytes using the underlying ReadBytes32 method. 392 func (s *StickyReader) ReadBytes32() []byte { 393 if s.Err != nil { 394 return nil 395 } 396 397 r, n, err := s.Reader.ReadBytes32() 398 s.Err = err 399 s.Count += int64(n) 400 401 return r 402 } 403 404 // ReadBytes40 will read a bytes using the underlying ReadBytes40 method. 405 func (s *StickyReader) ReadBytes40() []byte { 406 if s.Err != nil { 407 return nil 408 } 409 410 r, n, err := s.Reader.ReadBytes40() 411 s.Err = err 412 s.Count += int64(n) 413 414 return r 415 } 416 417 // ReadBytes48 will read a bytes using the underlying ReadBytes48 method. 418 func (s *StickyReader) ReadBytes48() []byte { 419 if s.Err != nil { 420 return nil 421 } 422 423 r, n, err := s.Reader.ReadBytes48() 424 s.Err = err 425 s.Count += int64(n) 426 427 return r 428 } 429 430 // ReadBytes56 will read a bytes using the underlying ReadBytes56 method. 431 func (s *StickyReader) ReadBytes56() []byte { 432 if s.Err != nil { 433 return nil 434 } 435 436 r, n, err := s.Reader.ReadBytes56() 437 s.Err = err 438 s.Count += int64(n) 439 440 return r 441 } 442 443 // ReadBytes64 will read a bytes using the underlying ReadBytes64 method. 444 func (s *StickyReader) ReadBytes64() []byte { 445 if s.Err != nil { 446 return nil 447 } 448 449 r, n, err := s.Reader.ReadBytes64() 450 s.Err = err 451 s.Count += int64(n) 452 453 return r 454 } 455 456 // ReadString will read a string using the underlying ReadString method. 457 func (s *StickyReader) ReadString(p int) string { 458 if s.Err != nil { 459 return "" 460 } 461 462 r, n, err := s.Reader.ReadString(p) 463 s.Err = err 464 s.Count += int64(n) 465 466 return r 467 } 468 469 // ReadString0 will read a string using the underlying ReadString0 method. 470 func (s *StickyReader) ReadString0() string { 471 if s.Err != nil { 472 return "" 473 } 474 475 r, n, err := s.Reader.ReadString0() 476 s.Err = err 477 s.Count += int64(n) 478 479 return r 480 } 481 482 // ReadStringX will read a string using the underlying ReadStringX method. 483 func (s *StickyReader) ReadStringX() string { 484 if s.Err != nil { 485 return "" 486 } 487 488 r, n, err := s.Reader.ReadStringX() 489 s.Err = err 490 s.Count += int64(n) 491 492 return r 493 } 494 495 // ReadString8 will read a string using the underlying ReadString8 method. 496 func (s *StickyReader) ReadString8() string { 497 if s.Err != nil { 498 return "" 499 } 500 501 r, n, err := s.Reader.ReadString8() 502 s.Err = err 503 s.Count += int64(n) 504 505 return r 506 } 507 508 // ReadString16 will read a string using the underlying ReadString16 method. 509 func (s *StickyReader) ReadString16() string { 510 if s.Err != nil { 511 return "" 512 } 513 514 r, n, err := s.Reader.ReadString16() 515 s.Err = err 516 s.Count += int64(n) 517 518 return r 519 } 520 521 // ReadString24 will read a string using the underlying ReadString24 method. 522 func (s *StickyReader) ReadString24() string { 523 if s.Err != nil { 524 return "" 525 } 526 527 r, n, err := s.Reader.ReadString24() 528 s.Err = err 529 s.Count += int64(n) 530 531 return r 532 } 533 534 // ReadString32 will read a string using the underlying ReadString32 method. 535 func (s *StickyReader) ReadString32() string { 536 if s.Err != nil { 537 return "" 538 } 539 540 r, n, err := s.Reader.ReadString32() 541 s.Err = err 542 s.Count += int64(n) 543 544 return r 545 } 546 547 // ReadString40 will read a string using the underlying ReadString40 method. 548 func (s *StickyReader) ReadString40() string { 549 if s.Err != nil { 550 return "" 551 } 552 553 r, n, err := s.Reader.ReadString40() 554 s.Err = err 555 s.Count += int64(n) 556 557 return r 558 } 559 560 // ReadString48 will read a string using the underlying ReadString48 method. 561 func (s *StickyReader) ReadString48() string { 562 if s.Err != nil { 563 return "" 564 } 565 566 r, n, err := s.Reader.ReadString48() 567 s.Err = err 568 s.Count += int64(n) 569 570 return r 571 } 572 573 // ReadString56 will read a string using the underlying ReadString56 method. 574 func (s *StickyReader) ReadString56() string { 575 if s.Err != nil { 576 return "" 577 } 578 579 r, n, err := s.Reader.ReadString56() 580 s.Err = err 581 s.Count += int64(n) 582 583 return r 584 } 585 586 // ReadString64 will read a string using the underlying ReadString64 method. 587 func (s *StickyReader) ReadString64() string { 588 if s.Err != nil { 589 return "" 590 } 591 592 r, n, err := s.Reader.ReadString64() 593 s.Err = err 594 s.Count += int64(n) 595 596 return r 597 } 598 599 // StickyWriter will wrap an EndianWriter and count all byte handled and errors 600 // received. 601 // Byte counts and errors will not be returned from any method (except Write so 602 // it still counts as an io.Writer), but can be retrieved from this type. 603 // All methods will be a no-op after an error has been returned, returning 0, 604 // unless that error is cleared on the type. 605 type StickyWriter struct { 606 Writer EndianWriter 607 Err error 608 Count int64 609 } 610 611 // GetCount returns any error received. 612 func (s *StickyWriter) GetError() error { 613 return s.Err 614 } 615 616 // GetCount returns the number of bytes written. 617 func (s *StickyWriter) GetCount() int64 { 618 return s.Count 619 } 620 621 // Write will do a simple byte write from the underlying io.Writer. 622 func (s *StickyWriter) Write(b []byte) (int, error) { 623 if s.Err != nil { 624 return 0, s.Err 625 } 626 627 n, err := s.Writer.Write(b) 628 s.Err = err 629 s.Count += int64(n) 630 631 return n, err 632 } 633 634 // Write will Write a byte write with the underlying io.Writer. 635 func (s *StickyWriter) WriteByte(b byte) error { 636 if s.Err != nil { 637 return s.Err 638 } 639 640 err := s.Writer.WriteByte(b) 641 s.Err = err 642 s.Count++ 643 644 return err 645 } 646 647 // Write will Write a boolean with the underlying io.Writer. 648 func (s *StickyWriter) WriteBool(b bool) { 649 if s.Err != nil { 650 return 651 } 652 653 n, err := s.Writer.WriteBool(b) 654 s.Err = err 655 s.Count += int64(n) 656 } 657 658 // WriteInt8 will write a int8 using the underlying writer. 659 func (s *StickyWriter) WriteInt8(i int8) { 660 if s.Err != nil { 661 return 662 } 663 664 n, err := s.Writer.WriteInt8(i) 665 s.Err = err 666 s.Count += int64(n) 667 } 668 669 // WriteInt16 will write a int16 using the underlying writer. 670 func (s *StickyWriter) WriteInt16(i int16) { 671 if s.Err != nil { 672 return 673 } 674 675 n, err := s.Writer.WriteInt16(i) 676 s.Err = err 677 s.Count += int64(n) 678 } 679 680 // WriteInt24 will write a int24 using the underlying writer. 681 func (s *StickyWriter) WriteInt24(i int32) { 682 if s.Err != nil { 683 return 684 } 685 686 n, err := s.Writer.WriteInt24(i) 687 s.Err = err 688 s.Count += int64(n) 689 } 690 691 // WriteInt32 will write a int32 using the underlying writer. 692 func (s *StickyWriter) WriteInt32(i int32) { 693 if s.Err != nil { 694 return 695 } 696 697 n, err := s.Writer.WriteInt32(i) 698 s.Err = err 699 s.Count += int64(n) 700 } 701 702 // WriteInt40 will write a int40 using the underlying writer. 703 func (s *StickyWriter) WriteInt40(i int64) { 704 if s.Err != nil { 705 return 706 } 707 708 n, err := s.Writer.WriteInt40(i) 709 s.Err = err 710 s.Count += int64(n) 711 } 712 713 // WriteInt48 will write a int48 using the underlying writer. 714 func (s *StickyWriter) WriteInt48(i int64) { 715 if s.Err != nil { 716 return 717 } 718 719 n, err := s.Writer.WriteInt48(i) 720 s.Err = err 721 s.Count += int64(n) 722 } 723 724 // WriteInt56 will write a int56 using the underlying writer. 725 func (s *StickyWriter) WriteInt56(i int64) { 726 if s.Err != nil { 727 return 728 } 729 730 n, err := s.Writer.WriteInt56(i) 731 s.Err = err 732 s.Count += int64(n) 733 } 734 735 // WriteInt64 will write a int64 using the underlying writer. 736 func (s *StickyWriter) WriteInt64(i int64) { 737 if s.Err != nil { 738 return 739 } 740 741 n, err := s.Writer.WriteInt64(i) 742 s.Err = err 743 s.Count += int64(n) 744 } 745 746 // WriteUint8 will write a uint8 using the underlying writer. 747 func (s *StickyWriter) WriteUint8(i uint8) { 748 if s.Err != nil { 749 return 750 } 751 752 n, err := s.Writer.WriteUint8(i) 753 s.Err = err 754 s.Count += int64(n) 755 } 756 757 // WriteUint16 will write a uint16 using the underlying writer. 758 func (s *StickyWriter) WriteUint16(i uint16) { 759 if s.Err != nil { 760 return 761 } 762 763 n, err := s.Writer.WriteUint16(i) 764 s.Err = err 765 s.Count += int64(n) 766 } 767 768 // WriteUint24 will write a uint24 using the underlying writer. 769 func (s *StickyWriter) WriteUint24(i uint32) { 770 if s.Err != nil { 771 return 772 } 773 774 n, err := s.Writer.WriteUint24(i) 775 s.Err = err 776 s.Count += int64(n) 777 } 778 779 // WriteUint32 will write a uint32 using the underlying writer. 780 func (s *StickyWriter) WriteUint32(i uint32) { 781 if s.Err != nil { 782 return 783 } 784 785 n, err := s.Writer.WriteUint32(i) 786 s.Err = err 787 s.Count += int64(n) 788 } 789 790 // WriteUint40 will write a uint40 using the underlying writer. 791 func (s *StickyWriter) WriteUint40(i uint64) { 792 if s.Err != nil { 793 return 794 } 795 796 n, err := s.Writer.WriteUint40(i) 797 s.Err = err 798 s.Count += int64(n) 799 } 800 801 // WriteUint48 will write a uint48 using the underlying writer. 802 func (s *StickyWriter) WriteUint48(i uint64) { 803 if s.Err != nil { 804 return 805 } 806 807 n, err := s.Writer.WriteUint48(i) 808 s.Err = err 809 s.Count += int64(n) 810 } 811 812 // WriteUint56 will write a uint56 using the underlying writer. 813 func (s *StickyWriter) WriteUint56(i uint64) { 814 if s.Err != nil { 815 return 816 } 817 818 n, err := s.Writer.WriteUint56(i) 819 s.Err = err 820 s.Count += int64(n) 821 } 822 823 // WriteUint64 will write a uint64 using the underlying writer. 824 func (s *StickyWriter) WriteUint64(i uint64) { 825 if s.Err != nil { 826 return 827 } 828 829 n, err := s.Writer.WriteUint64(i) 830 s.Err = err 831 s.Count += int64(n) 832 } 833 834 // WriteFloat32 will write a float32 using the underlying writer. 835 func (s *StickyWriter) WriteFloat32(i float32) { 836 if s.Err != nil { 837 return 838 } 839 840 n, err := s.Writer.WriteFloat32(i) 841 s.Err = err 842 s.Count += int64(n) 843 } 844 845 // WriteFloat64 will write a float64 using the underlying writer. 846 func (s *StickyWriter) WriteFloat64(i float64) { 847 if s.Err != nil { 848 return 849 } 850 851 n, err := s.Writer.WriteFloat64(i) 852 s.Err = err 853 s.Count += int64(n) 854 } 855 856 // WriteIntX will write a 64-bit var-int using the underlying WriteIntX method. 857 func (s *StickyWriter) WriteIntX(i int64) { 858 if s.Err != nil { 859 return 860 } 861 862 n, err := s.Writer.WriteIntX(i) 863 s.Err = err 864 s.Count += int64(n) 865 } 866 867 // WriteUintX will write a 64-bit var-uint using the underlying WriteUintX method. 868 func (s *StickyWriter) WriteUintX(i uint64) { 869 if s.Err != nil { 870 return 871 } 872 873 n, err := s.Writer.WriteUintX(i) 874 s.Err = err 875 s.Count += int64(n) 876 } 877 878 // WriteBytes will write a bytes using the underlying WriteBytes method. 879 func (s *StickyWriter) WriteBytes(p []byte) { 880 if s.Err != nil { 881 return 882 } 883 884 n, err := s.Writer.WriteBytes(p) 885 s.Err = err 886 s.Count += int64(n) 887 } 888 889 // WriteBytesX will write a bytes using the underlying WriteBytesX method. 890 func (s *StickyWriter) WriteBytesX(p []byte) { 891 if s.Err != nil { 892 return 893 } 894 895 n, err := s.Writer.WriteBytesX(p) 896 s.Err = err 897 s.Count += int64(n) 898 } 899 900 // WriteBytes8 will write a bytes using the underlying WriteBytes8 method. 901 func (s *StickyWriter) WriteBytes8(p []byte) { 902 if s.Err != nil { 903 return 904 } 905 906 n, err := s.Writer.WriteBytes8(p) 907 s.Err = err 908 s.Count += int64(n) 909 } 910 911 // WriteBytes16 will write a bytes using the underlying WriteBytes16 method. 912 func (s *StickyWriter) WriteBytes16(p []byte) { 913 if s.Err != nil { 914 return 915 } 916 917 n, err := s.Writer.WriteBytes16(p) 918 s.Err = err 919 s.Count += int64(n) 920 } 921 922 // WriteBytes24 will write a bytes using the underlying WriteBytes24 method. 923 func (s *StickyWriter) WriteBytes24(p []byte) { 924 if s.Err != nil { 925 return 926 } 927 928 n, err := s.Writer.WriteBytes24(p) 929 s.Err = err 930 s.Count += int64(n) 931 } 932 933 // WriteBytes32 will write a bytes using the underlying WriteBytes32 method. 934 func (s *StickyWriter) WriteBytes32(p []byte) { 935 if s.Err != nil { 936 return 937 } 938 939 n, err := s.Writer.WriteBytes32(p) 940 s.Err = err 941 s.Count += int64(n) 942 } 943 944 // WriteBytes40 will write a bytes using the underlying WriteBytes40 method. 945 func (s *StickyWriter) WriteBytes40(p []byte) { 946 if s.Err != nil { 947 return 948 } 949 950 n, err := s.Writer.WriteBytes40(p) 951 s.Err = err 952 s.Count += int64(n) 953 } 954 955 // WriteBytes48 will write a bytes using the underlying WriteBytes48 method. 956 func (s *StickyWriter) WriteBytes48(p []byte) { 957 if s.Err != nil { 958 return 959 } 960 961 n, err := s.Writer.WriteBytes48(p) 962 s.Err = err 963 s.Count += int64(n) 964 } 965 966 // WriteBytes56 will write a bytes using the underlying WriteBytes56 method. 967 func (s *StickyWriter) WriteBytes56(p []byte) { 968 if s.Err != nil { 969 return 970 } 971 972 n, err := s.Writer.WriteBytes56(p) 973 s.Err = err 974 s.Count += int64(n) 975 } 976 977 // WriteBytes64 will write a bytes using the underlying WriteBytes64 method. 978 func (s *StickyWriter) WriteBytes64(p []byte) { 979 if s.Err != nil { 980 return 981 } 982 983 n, err := s.Writer.WriteBytes64(p) 984 s.Err = err 985 s.Count += int64(n) 986 } 987 988 // WriteString will write a string using the underlying WriteString method. 989 func (s *StickyWriter) WriteString(p string) (int, error) { 990 if s.Err != nil { 991 return 0, s.Err 992 } 993 994 n, err := s.Writer.WriteString(p) 995 s.Err = err 996 s.Count += int64(n) 997 998 return n, err 999 } 1000 1001 // WriteString0 will write a string using the underlying WriteString0 method. 1002 func (s *StickyWriter) WriteString0(p string) { 1003 if s.Err != nil { 1004 return 1005 } 1006 1007 n, err := s.Writer.WriteString0(p) 1008 s.Err = err 1009 s.Count += int64(n) 1010 } 1011 1012 // WriteStringX will write a string using the underlying WriteStringX method. 1013 func (s *StickyWriter) WriteStringX(p string) { 1014 if s.Err != nil { 1015 return 1016 } 1017 1018 n, err := s.Writer.WriteStringX(p) 1019 s.Err = err 1020 s.Count += int64(n) 1021 } 1022 1023 // WriteString8 will write a string using the underlying WriteString8 method. 1024 func (s *StickyWriter) WriteString8(p string) { 1025 if s.Err != nil { 1026 return 1027 } 1028 1029 n, err := s.Writer.WriteString8(p) 1030 s.Err = err 1031 s.Count += int64(n) 1032 } 1033 1034 // WriteString16 will write a string using the underlying WriteString16 method. 1035 func (s *StickyWriter) WriteString16(p string) { 1036 if s.Err != nil { 1037 return 1038 } 1039 1040 n, err := s.Writer.WriteString16(p) 1041 s.Err = err 1042 s.Count += int64(n) 1043 } 1044 1045 // WriteString24 will write a string using the underlying WriteString24 method. 1046 func (s *StickyWriter) WriteString24(p string) { 1047 if s.Err != nil { 1048 return 1049 } 1050 1051 n, err := s.Writer.WriteString24(p) 1052 s.Err = err 1053 s.Count += int64(n) 1054 } 1055 1056 // WriteString32 will write a string using the underlying WriteString32 method. 1057 func (s *StickyWriter) WriteString32(p string) { 1058 if s.Err != nil { 1059 return 1060 } 1061 1062 n, err := s.Writer.WriteString32(p) 1063 s.Err = err 1064 s.Count += int64(n) 1065 } 1066 1067 // WriteString40 will write a string using the underlying WriteString40 method. 1068 func (s *StickyWriter) WriteString40(p string) { 1069 if s.Err != nil { 1070 return 1071 } 1072 1073 n, err := s.Writer.WriteString40(p) 1074 s.Err = err 1075 s.Count += int64(n) 1076 } 1077 1078 // WriteString48 will write a string using the underlying WriteString48 method. 1079 func (s *StickyWriter) WriteString48(p string) { 1080 if s.Err != nil { 1081 return 1082 } 1083 1084 n, err := s.Writer.WriteString48(p) 1085 s.Err = err 1086 s.Count += int64(n) 1087 } 1088 1089 // WriteString56 will write a string using the underlying WriteString56 method. 1090 func (s *StickyWriter) WriteString56(p string) { 1091 if s.Err != nil { 1092 return 1093 } 1094 1095 n, err := s.Writer.WriteString56(p) 1096 s.Err = err 1097 s.Count += int64(n) 1098 } 1099 1100 // WriteString64 will write a string using the underlying WriteString64 method. 1101 func (s *StickyWriter) WriteString64(p string) { 1102 if s.Err != nil { 1103 return 1104 } 1105 1106 n, err := s.Writer.WriteString64(p) 1107 s.Err = err 1108 s.Count += int64(n) 1109 } 1110