test_class.declarator: MAINNET = MainNetParams.get()
test_class.modifier: private static final
test_class.original_string: private static final NetworkParameters MAINNET = MainNetParams.get();
test_class.type: NetworkParameters
test_class.var_name: MAINNET
test_class.declarator: ADDRESS_MESSAGE_BYTES = HEX.decode("f9beb4d96164647200000000000000001f000000" +
              "ed52399b01e215104d010000000000000000000000000000000000ffff0a000001208d")
test_class.modifier: private static final
test_class.original_string: private static final byte[] ADDRESS_MESSAGE_BYTES = HEX.decode("f9beb4d96164647200000000000000001f000000" +
              "ed52399b01e215104d010000000000000000000000000000000000ffff0a000001208d");
test_class.type: byte[]
test_class.var_name: ADDRESS_MESSAGE_BYTES
test_class.declarator: TRANSACTION_MESSAGE_BYTES = HEX.withSeparator(" ", 2).decode(
              "f9 be b4 d9 74 78 00 00  00 00 00 00 00 00 00 00" +
              "02 01 00 00 e2 93 cd be  01 00 00 00 01 6d bd db" +
              "08 5b 1d 8a f7 51 84 f0  bc 01 fa d5 8d 12 66 e9" +
              "b6 3b 50 88 19 90 e4 b4  0d 6a ee 36 29 00 00 00" +
              "00 8b 48 30 45 02 21 00  f3 58 1e 19 72 ae 8a c7" +
              "c7 36 7a 7a 25 3b c1 13  52 23 ad b9 a4 68 bb 3a" +
              "59 23 3f 45 bc 57 83 80  02 20 59 af 01 ca 17 d0" +
              "0e 41 83 7a 1d 58 e9 7a  a3 1b ae 58 4e de c2 8d" +
              "35 bd 96 92 36 90 91 3b  ae 9a 01 41 04 9c 02 bf" +
              "c9 7e f2 36 ce 6d 8f e5  d9 40 13 c7 21 e9 15 98" +
              "2a cd 2b 12 b6 5d 9b 7d  59 e2 0a 84 20 05 f8 fc" +
              "4e 02 53 2e 87 3d 37 b9  6f 09 d6 d4 51 1a da 8f" +
              "14 04 2f 46 61 4a 4c 70  c0 f1 4b ef f5 ff ff ff" +
              "ff 02 40 4b 4c 00 00 00  00 00 19 76 a9 14 1a a0" +
              "cd 1c be a6 e7 45 8a 7a  ba d5 12 a9 d9 ea 1a fb" +
              "22 5e 88 ac 80 fa e9 c7  00 00 00 00 19 76 a9 14" +
              "0e ab 5b ea 43 6a 04 84  cf ab 12 48 5e fd a0 b7" +
              "8b 4e cc 52 88 ac 00 00  00 00")
test_class.modifier: private static final
test_class.original_string: private static final byte[] TRANSACTION_MESSAGE_BYTES = HEX.withSeparator(" ", 2).decode(
              "f9 be b4 d9 74 78 00 00  00 00 00 00 00 00 00 00" +
              "02 01 00 00 e2 93 cd be  01 00 00 00 01 6d bd db" +
              "08 5b 1d 8a f7 51 84 f0  bc 01 fa d5 8d 12 66 e9" +
              "b6 3b 50 88 19 90 e4 b4  0d 6a ee 36 29 00 00 00" +
              "00 8b 48 30 45 02 21 00  f3 58 1e 19 72 ae 8a c7" +
              "c7 36 7a 7a 25 3b c1 13  52 23 ad b9 a4 68 bb 3a" +
              "59 23 3f 45 bc 57 83 80  02 20 59 af 01 ca 17 d0" +
              "0e 41 83 7a 1d 58 e9 7a  a3 1b ae 58 4e de c2 8d" +
              "35 bd 96 92 36 90 91 3b  ae 9a 01 41 04 9c 02 bf" +
              "c9 7e f2 36 ce 6d 8f e5  d9 40 13 c7 21 e9 15 98" +
              "2a cd 2b 12 b6 5d 9b 7d  59 e2 0a 84 20 05 f8 fc" +
              "4e 02 53 2e 87 3d 37 b9  6f 09 d6 d4 51 1a da 8f" +
              "14 04 2f 46 61 4a 4c 70  c0 f1 4b ef f5 ff ff ff" +
              "ff 02 40 4b 4c 00 00 00  00 00 19 76 a9 14 1a a0" +
              "cd 1c be a6 e7 45 8a 7a  ba d5 12 a9 d9 ea 1a fb" +
              "22 5e 88 ac 80 fa e9 c7  00 00 00 00 19 76 a9 14" +
              "0e ab 5b ea 43 6a 04 84  cf ab 12 48 5e fd a0 b7" +
              "8b 4e cc 52 88 ac 00 00  00 00");
test_class.type: byte[]
test_class.var_name: TRANSACTION_MESSAGE_BYTES
test_class.file: core/src/test/java/org/ulordj/core/UlordSerializerTest.java
test_class.identifier: UlordSerializerTest
test_case.body: @Test(expected = BufferUnderflowException.class)
      public void testSeekPastMagicBytes() {
          // Fail in another way, there is data in the stream but no magic bytes.
          byte[] brokenMessage = HEX.decode("000000");
          MAINNET.getDefaultSerializer().seekPastMagicBytes(ByteBuffer.wrap(brokenMessage));
      }
test_case.class_method_signature: UlordSerializerTest.testSeekPastMagicBytes()
test_case.full_signature: @Test(expected = BufferUnderflowException.class) public void testSeekPastMagicBytes()
test_case.identifier: testSeekPastMagicBytes
test_case.invocations: decode seekPastMagicBytes getDefaultSerializer wrap
test_case.modifiers: @Test(expected = BufferUnderflowException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSeekPastMagicBytes()
focal_class.declarator: log = LoggerFactory.getLogger(UlordSerializer.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(UlordSerializer.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: COMMAND_LEN = 12
focal_class.modifier: private static final
focal_class.original_string: private static final int COMMAND_LEN = 12;
focal_class.type: int
focal_class.var_name: COMMAND_LEN
focal_class.declarator: params
focal_class.modifier: private final
focal_class.original_string: private final NetworkParameters params;
focal_class.type: NetworkParameters
focal_class.var_name: params
focal_class.declarator: parseRetain
focal_class.modifier: private final
focal_class.original_string: private final boolean parseRetain;
focal_class.type: boolean
focal_class.var_name: parseRetain
focal_class.declarator: names = new HashMap<>()
focal_class.modifier: private static final
focal_class.original_string: private static final Map<Class<? extends Message>, String> names = new HashMap<>();
focal_class.type: Map<Class<? extends Message>, String>
focal_class.var_name: names
focal_class.file: core/src/main/java/org/ulordj/core/UlordSerializer.java
focal_class.identifier: UlordSerializer
focal_class.class_method_signature: UlordSerializer.UlordSerializer(NetworkParameters params, boolean parseRetain)
focal_class.full_signature: public  UlordSerializer(NetworkParameters params, boolean parseRetain)
focal_class.identifier: UlordSerializer
focal_class.modifiers: public
focal_class.parameters: (NetworkParameters params, boolean parseRetain)
focal_class.signature:  UlordSerializer(NetworkParameters params, boolean parseRetain)
focal_class.class_method_signature: UlordSerializer.serialize(String name, byte[] message, OutputStream out)
focal_class.full_signature: @Override public void serialize(String name, byte[] message, OutputStream out)
focal_class.identifier: serialize
focal_class.modifiers: @Override public
focal_class.parameters: (String name, byte[] message, OutputStream out)
focal_class.return: void
focal_class.signature: void serialize(String name, byte[] message, OutputStream out)
focal_class.class_method_signature: UlordSerializer.serialize(Message message, OutputStream out)
focal_class.full_signature: @Override public void serialize(Message message, OutputStream out)
focal_class.identifier: serialize
focal_class.modifiers: @Override public
focal_class.parameters: (Message message, OutputStream out)
focal_class.return: void
focal_class.signature: void serialize(Message message, OutputStream out)
focal_class.class_method_signature: UlordSerializer.deserialize(ByteBuffer in)
focal_class.full_signature: @Override public Message deserialize(ByteBuffer in)
focal_class.identifier: deserialize
focal_class.modifiers: @Override public
focal_class.parameters: (ByteBuffer in)
focal_class.return: Message
focal_class.signature: Message deserialize(ByteBuffer in)
focal_class.class_method_signature: UlordSerializer.deserializeHeader(ByteBuffer in)
focal_class.full_signature: @Override public BitcoinPacketHeader deserializeHeader(ByteBuffer in)
focal_class.identifier: deserializeHeader
focal_class.modifiers: @Override public
focal_class.parameters: (ByteBuffer in)
focal_class.return: BitcoinPacketHeader
focal_class.signature: BitcoinPacketHeader deserializeHeader(ByteBuffer in)
focal_class.class_method_signature: UlordSerializer.deserializePayload(BitcoinPacketHeader header, ByteBuffer in)
focal_class.full_signature: @Override public Message deserializePayload(BitcoinPacketHeader header, ByteBuffer in)
focal_class.identifier: deserializePayload
focal_class.modifiers: @Override public
focal_class.parameters: (BitcoinPacketHeader header, ByteBuffer in)
focal_class.return: Message
focal_class.signature: Message deserializePayload(BitcoinPacketHeader header, ByteBuffer in)
focal_class.class_method_signature: UlordSerializer.makeMessage(String command, int length, byte[] payloadBytes, byte[] hash, byte[] checksum)
focal_class.full_signature: private Message makeMessage(String command, int length, byte[] payloadBytes, byte[] hash, byte[] checksum)
focal_class.identifier: makeMessage
focal_class.modifiers: private
focal_class.parameters: (String command, int length, byte[] payloadBytes, byte[] hash, byte[] checksum)
focal_class.return: Message
focal_class.signature: Message makeMessage(String command, int length, byte[] payloadBytes, byte[] hash, byte[] checksum)
focal_class.class_method_signature: UlordSerializer.getParameters()
focal_class.full_signature: public NetworkParameters getParameters()
focal_class.identifier: getParameters
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: NetworkParameters
focal_class.signature: NetworkParameters getParameters()
focal_class.class_method_signature: UlordSerializer.makeAddressMessage(byte[] payloadBytes, int length)
focal_class.full_signature: @Override public AddressMessage makeAddressMessage(byte[] payloadBytes, int length)
focal_class.identifier: makeAddressMessage
focal_class.modifiers: @Override public
focal_class.parameters: (byte[] payloadBytes, int length)
focal_class.return: AddressMessage
focal_class.signature: AddressMessage makeAddressMessage(byte[] payloadBytes, int length)
focal_class.class_method_signature: UlordSerializer.makeAlertMessage(byte[] payloadBytes)
focal_class.full_signature: @Override public Message makeAlertMessage(byte[] payloadBytes)
focal_class.identifier: makeAlertMessage
focal_class.modifiers: @Override public
focal_class.parameters: (byte[] payloadBytes)
focal_class.return: Message
focal_class.signature: Message makeAlertMessage(byte[] payloadBytes)
focal_class.class_method_signature: UlordSerializer.makeBlock(final byte[] payloadBytes, final int offset, final int length)
focal_class.full_signature: @Override public Block makeBlock(final byte[] payloadBytes, final int offset, final int length)
focal_class.identifier: makeBlock
focal_class.modifiers: @Override public
focal_class.parameters: (final byte[] payloadBytes, final int offset, final int length)
focal_class.return: Block
focal_class.signature: Block makeBlock(final byte[] payloadBytes, final int offset, final int length)
focal_class.class_method_signature: UlordSerializer.makeBloomFilter(byte[] payloadBytes)
focal_class.full_signature: @Override public Message makeBloomFilter(byte[] payloadBytes)
focal_class.identifier: makeBloomFilter
focal_class.modifiers: @Override public
focal_class.parameters: (byte[] payloadBytes)
focal_class.return: Message
focal_class.signature: Message makeBloomFilter(byte[] payloadBytes)
focal_class.class_method_signature: UlordSerializer.makeFilteredBlock(byte[] payloadBytes)
focal_class.full_signature: @Override public FilteredBlock makeFilteredBlock(byte[] payloadBytes)
focal_class.identifier: makeFilteredBlock
focal_class.modifiers: @Override public
focal_class.parameters: (byte[] payloadBytes)
focal_class.return: FilteredBlock
focal_class.signature: FilteredBlock makeFilteredBlock(byte[] payloadBytes)
focal_class.class_method_signature: UlordSerializer.makeInventoryMessage(byte[] payloadBytes, int length)
focal_class.full_signature: @Override public InventoryMessage makeInventoryMessage(byte[] payloadBytes, int length)
focal_class.identifier: makeInventoryMessage
focal_class.modifiers: @Override public
focal_class.parameters: (byte[] payloadBytes, int length)
focal_class.return: InventoryMessage
focal_class.signature: InventoryMessage makeInventoryMessage(byte[] payloadBytes, int length)
focal_class.class_method_signature: UlordSerializer.makeTransaction(byte[] payloadBytes, int offset,
          int length, byte[] hash)
focal_class.full_signature: @Override public Transaction makeTransaction(byte[] payloadBytes, int offset,
          int length, byte[] hash)
focal_class.identifier: makeTransaction
focal_class.modifiers: @Override public
focal_class.parameters: (byte[] payloadBytes, int offset,
          int length, byte[] hash)
focal_class.return: Transaction
focal_class.signature: Transaction makeTransaction(byte[] payloadBytes, int offset,
          int length, byte[] hash)
focal_class.class_method_signature: UlordSerializer.seekPastMagicBytes(ByteBuffer in)
focal_class.full_signature: @Override public void seekPastMagicBytes(ByteBuffer in)
focal_class.identifier: seekPastMagicBytes
focal_class.modifiers: @Override public
focal_class.parameters: (ByteBuffer in)
focal_class.return: void
focal_class.signature: void seekPastMagicBytes(ByteBuffer in)
focal_class.class_method_signature: UlordSerializer.isParseRetainMode()
focal_class.full_signature: @Override public boolean isParseRetainMode()
focal_class.identifier: isParseRetainMode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isParseRetainMode()
focal_class.superclass: extends MessageSerializer
focal_method.body: @Override
      public void seekPastMagicBytes(ByteBuffer in) throws BufferUnderflowException {
          int magicCursor = 3;  // Which byte of the magic we're looking for currently.
          while (true) {
              byte b = in.get();
              // We're looking for a run of bytes that is the same as the packet magic but we want to ignore partial
              // magics that aren't complete. So we keep track of where we're up to with magicCursor.
              byte expectedByte = (byte)(0xFF & params.getPacketMagic() >>> (magicCursor * 8));
              if (b == expectedByte) {
                  magicCursor--;
                  if (magicCursor < 0) {
                      // We found the magic sequence.
                      return;
                  } else {
                      // We still have further to go to find the next message.
                  }
              } else {
                  magicCursor = 3;
              }
          }
      }
focal_method.class_method_signature: UlordSerializer.seekPastMagicBytes(ByteBuffer in)
focal_method.full_signature: @Override public void seekPastMagicBytes(ByteBuffer in)
focal_method.identifier: seekPastMagicBytes
focal_method.invocations: get getPacketMagic
focal_method.modifiers: @Override public
focal_method.parameters: (ByteBuffer in)
focal_method.return: void
focal_method.signature: void seekPastMagicBytes(ByteBuffer in)