SRIOConsumer.m 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // Copyright 2012 Square Inc.
  3. // Portions Copyright (c) 2016-present, Facebook, Inc.
  4. //
  5. // All rights reserved.
  6. //
  7. // This source code is licensed under the BSD-style license found in the
  8. // LICENSE file in the root directory of this source tree. An additional grant
  9. // of patent rights can be found in the PATENTS file in the same directory.
  10. //
  11. #import "SRIOConsumer.h"
  12. @implementation SRIOConsumer
  13. @synthesize bytesNeeded = _bytesNeeded;
  14. @synthesize consumer = _scanner;
  15. @synthesize handler = _handler;
  16. @synthesize readToCurrentFrame = _readToCurrentFrame;
  17. @synthesize unmaskBytes = _unmaskBytes;
  18. - (void)resetWithScanner:(stream_scanner)scanner
  19. handler:(data_callback)handler
  20. bytesNeeded:(size_t)bytesNeeded
  21. readToCurrentFrame:(BOOL)readToCurrentFrame
  22. unmaskBytes:(BOOL)unmaskBytes
  23. {
  24. _scanner = [scanner copy];
  25. _handler = [handler copy];
  26. _bytesNeeded = bytesNeeded;
  27. _readToCurrentFrame = readToCurrentFrame;
  28. _unmaskBytes = unmaskBytes;
  29. assert(_scanner || _bytesNeeded);
  30. }
  31. @end