PageRenderTime 327ms CodeModel.GetById 309ms RepoModel.GetById 0ms app.codeStats 0ms

/js/lib/Socket.IO-node/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/ByteString.as

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs
ActionScript | 43 lines | 28 code | 7 blank | 8 comment | 0 complexity | a2b660f7970ef36aeb6a0c5a28302b05 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, MPL-2.0-no-copyleft-exception, BSD-3-Clause
  1. /**
  2. * ByteString
  3. *
  4. * An ASN1 type for a ByteString, represented with a ByteArray
  5. * Copyright (c) 2007 Henri Torgemane
  6. *
  7. * See LICENSE.txt for full license information.
  8. */
  9. package com.hurlant.util.der
  10. {
  11. import flash.utils.ByteArray;
  12. import com.hurlant.util.Hex;
  13. public class ByteString extends ByteArray implements IAsn1Type
  14. {
  15. private var type:uint;
  16. private var len:uint;
  17. public function ByteString(type:uint = 0x04, length:uint = 0x00) {
  18. this.type = type;
  19. this.len = length;
  20. }
  21. public function getLength():uint
  22. {
  23. return len;
  24. }
  25. public function getType():uint
  26. {
  27. return type;
  28. }
  29. public function toDER():ByteArray {
  30. return DER.wrapDER(type, this);
  31. }
  32. override public function toString():String {
  33. return DER.indent+"ByteString["+type+"]["+len+"]["+Hex.fromArray(this)+"]";
  34. }
  35. }
  36. }