<commit_before>package org.glob3.mobile.generated; 
//
//  ByteBufferBuilder.cpp
//  G3MiOSSDK
//
//  Created by <NAME> on 1/3/13.
//
//

//
//  ByteBufferBuilder.hpp
//  G3MiOSSDK
//
//  Created by <NAME> on 1/3/13.
//
//


//C++ TO JAVA CONVERTER NOTE: Java has no need of forward class declarations:
//class IByteBuffer;

public class ByteBufferBuilder
{
  private java.util.ArrayList<Byte> _values = new java.util.ArrayList<Byte>();


  public final void addInt64(long value)
  {
	final byte b1 = (value) & 0xFF;
	final byte b2 = (value >> 8) & 0xFF;
	final byte b3 = (value >> 16) & 0xFF;
	final byte b4 = (value >> 24) & 0xFF;
	final byte b5 = (value >> 32) & 0xFF;
	final byte b6 = (value >> 40) & 0xFF;
	final byte b7 = (value >> 48) & 0xFF;
	final byte b8 = (value >> 56) & 0xFF;

	_values.add(b1);
	_values.add(b2);
	_values.add(b3);
	_values.add(b4);
	_values.add(b5);
	_values.add(b6);
	_values.add(b7);
	_values.add(b8);
  }

  public final void addDouble(double value)
  {
	addInt64(IMathUtils.instance().doubleToRawLongBits(value));
  }

  public final void addInt32(int value)
  {
	final byte b1 = (value) & 0xFF;
	final byte b2 = (value >> 8) & 0xFF;
	final byte b3 = (value >> 16) & 0xFF;
	final byte b4 = (value >> 24) & 0xFF;

	_values.add(b1);
	_values.add(b2);
	_values.add(b3);
	_values.add(b4);
  }

  public final void setInt32(int i, int value)
  {
	final byte b1 = (value) & 0xFF;
	final byte b2 = (value >> 8) & 0xFF;
	final byte b3 = (value >> 16) & 0xFF;
	final byte b4 = (value >> 24) & 0xFF;

	_values.set(i, b1);
	_values.set(i + 1, b2);
	_values.set(i + 2, b3);
	_values.set(i + 3, b4);
  }

  public final void addStringZeroTerminated(String String)
  {
	final int size = String.length();
	for (int i = 0; i < size; i++)
	{
	  final byte c = String.charAt(i);
	  _values.add(c);
	}
	_values.add(0);
  }

  public final void add(byte value)
  {
	_values.add(value);
  }

//C++ TO JAVA CONVERTER WARNING: 'const' methods are not available in Java:
//ORIGINAL LINE: int size() const
  public final int size()
  {
	return _values.size();
  }

//C++ TO JAVA CONVERTER WARNING: 'const' methods are not available in Java:
//ORIGINAL LINE: IByteBuffer* create() const
  public final IByteBuffer create()
  {
	final int size = _values.size();
  
	IByteBuffer result = IFactory.instance().createByteBuffer(size);
  
	for (int i = 0; i < size; i++)
	{
	  result.rawPut(i, _values.get(i));
	}
  
	return result;
  }

}<commit_msg>Generated<commit_after>package org.glob3.mobile.generated; 
//
//  ByteBufferBuilder.cpp
//  G3MiOSSDK
//
//  Created by <NAME> on 1/3/13.
//
//

//
//  ByteBufferBuilder.hpp
//  G3MiOSSDK
//
//  Created by <NAME> on 1/3/13.
//
//


//C++ TO JAVA CONVERTER NOTE: Java has no need of forward class declarations:
//class IByteBuffer;

public class ByteBufferBuilder
{
  private java.util.ArrayList<Byte> _values = new java.util.ArrayList<Byte>();


  public final void addInt64(long value)
  {
	final byte b1 = (byte)((value) & 0xFF);
	final byte b2 = (byte)((value >> 8) & 0xFF);
	final byte b3 = (byte)((value >> 16) & 0xFF);
	final byte b4 = (byte)((value >> 24) & 0xFF);
	final byte b5 = (byte)((value >> 32) & 0xFF);
	final byte b6 = (byte)((value >> 40) & 0xFF);
	final byte b7 = (byte)((value >> 48) & 0xFF);
	final byte b8 = (byte)((value >> 56) & 0xFF);

	_values.add(b1);
	_values.add(b2);
	_values.add(b3);
	_values.add(b4);
	_values.add(b5);
	_values.add(b6);
	_values.add(b7);
	_values.add(b8);
  }

  public final void addDouble(double value)
  {
	addInt64(IMathUtils.instance().doubleToRawLongBits(value));
  }

  public final void addInt32(int value)
  {
	final byte b1 = (byte)((value) & 0xFF);
	final byte b2 = (byte)((value >> 8) & 0xFF);
	final byte b3 = (byte)((value >> 16) & 0xFF);
	final byte b4 = (byte)((value >> 24) & 0xFF);

	_values.add(b1);
	_values.add(b2);
	_values.add(b3);
	_values.add(b4);
  }

  public final void setInt32(int i, int value)
  {
	final byte b1 = (byte)((value) & 0xFF);
	final byte b2 = (byte)((value >> 8) & 0xFF);
	final byte b3 = (byte)((value >> 16) & 0xFF);
	final byte b4 = (byte)((value >> 24) & 0xFF);

	_values.set(i, b1);
	_values.set(i + 1, b2);
	_values.set(i + 2, b3);
	_values.set(i + 3, b4);
  }

  public final void addStringZeroTerminated(String String)
  {
	final int size = String.length();
	for (int i = 0; i < size; i++)
	{
	  final byte c = String.charAt(i);
	  _values.add(c);
	}
	_values.add((byte) 0);
  }

  public final void add(byte value)
  {
	_values.add(value);
  }

//C++ TO JAVA CONVERTER WARNING: 'const' methods are not available in Java:
//ORIGINAL LINE: int size() const
  public final int size()
  {
	return _values.size();
  }

//C++ TO JAVA CONVERTER WARNING: 'const' methods are not available in Java:
//ORIGINAL LINE: IByteBuffer* create() const
  public final IByteBuffer create()
  {
	final int size = _values.size();
  
	IByteBuffer result = IFactory.instance().createByteBuffer(size);
  
	for (int i = 0; i < size; i++)
	{
	  result.rawPut(i, _values.get(i));
	}
  
	return result;
  }

}
{'fraction_non_alphanumeric': 0.15822424587364825, 'fraction_numerical': 0.03642572566875356, 'mean_word_length': 2.7657142857142856, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6348146', 'n_tokens_mistral': 2218, 'n_tokens_neox': 2033, 'n_words': 537}