Examples of ByteArrayList


Examples of com.benkyou.util.ByteArrayList

    private GameServer gameServer;

    public WebcamServer(GameServer gameServer) {
        Serializer.registerClass(WebcamMessage.class);
        this.gameServer = gameServer;
        bal = new ByteArrayList();
    }
View Full Code Here

Examples of com.carrotsearch.hppc.ByteArrayList

    /* */
    @BeforeClass
    public static void before()
    {
        list = new ByteArrayList();
        list.resize(CELLS);
    }
View Full Code Here

Examples of com.gs.collections.impl.list.mutable.primitive.ByteArrayList

        return target;
    }

    public MutableByteCollection collectByte(ByteFunction<? super V> byteFunction)
    {
        return this.collectByte(byteFunction,  new ByteArrayList(this.size()));
    }
View Full Code Here

Examples of it.unimi.dsi.fastutil.bytes.ByteArrayList

    void runInput(InputStream in, AbstractDownload d) throws IOException {
        Logger.getLogger(Downloader.class.getName()).entering(Downloader.class.getName(), "runInput");
        if (d.getStatus() == DownloadStatus.DOWNLOADING) {
            int read;
            StopWatch bufferWatch = new StopWatch();
            ByteArrayList chunk = new ByteArrayList();
            byte inputBuffer[] = new byte[128];
            byte outputBuffer[] = new byte[128];
            int multiplier = 1;
            int growCount = 0;
            int shrinkCount = 0;
            int changeOn = 5;
            int accelerateOn = 10;
            bufferWatch.start();
            read = in.read(inputBuffer);
            d.initDownloadTime();
            while (read != -1 && d.getStatus() == DownloadStatus.DOWNLOADING) {
                assert (multiplier > 0);
                for (int i = 0; i < multiplier && read != -1 && d.getStatus() == DownloadStatus.DOWNLOADING; i++) {
                    chunk.addElements(chunk.size(), inputBuffer, 0, read);
                    read = in.read(inputBuffer);
                }
                d.updateDownloadTime();
                if (chunk.size() > outputBuffer.length) {
                    outputBuffer = new byte[chunk.size()];
                }
                processor.doChunck(chunk.size(), chunk.toByteArray(outputBuffer));
                d.setDownloaded(d.getDownloaded() + chunk.size());
                chunk.clear();
                bufferWatch.add();
                //System.out.print(bufferWatch);
                long maxTime = getdSettings().getBufferTime() * 1000000;
                if (bufferWatch.getTime() < maxTime) {
                    growCount++;
View Full Code Here

Examples of jodd.util.collection.ByteArrayList

    }

    if (value instanceof Iterable) {
      Iterable iterable = (Iterable) value;

      ByteArrayList byteArrayList = new ByteArrayList();
      for (Object element : iterable) {
        byte convertedValue = convertType(element);
        byteArrayList.add(convertedValue);
            }

      return byteArrayList.toArray();
    }

    if (value instanceof CharSequence) {
      String[] strings = StringUtil.splitc(value.toString(), ArrayConverter.NUMBER_DELIMITERS);
      return convertArrayToArray(strings);
View Full Code Here

Examples of net.sf.xbus.base.bytearraylist.ByteArrayList

   *         {@link net.sf.xbus.base.bytearraylist.ByteArrayList}.
   * @exception XException if file can not be read or any I/O error occurs
   */
  protected Object getRequestContent() throws XException
  {
    ByteArrayList retBuffer = new ByteArrayList();

    AS400FileRecordDescription recordDescription = new AS400FileRecordDescription(
        mAS400System, mQSYSObject.getPath());

    try
    {
      // Set record format of the file.
      RecordFormat[] format = recordDescription.retrieveRecordFormat();
      mOriginFile.setRecordFormat(format[0]);

      // Open the file.
      mOriginFile.open(AS400File.READ_WRITE, 0,
          AS400File.COMMIT_LOCK_LEVEL_NONE);

      // Read records
      byte[] inData = null;
      Record record;
      while ((record = mOriginFile.readNext()) != null)
      {
        inData = record.getContents();
        retBuffer.add(inData);
      }
      // close the file since I am done using it
      mOriginFile.close();

    }
View Full Code Here

Examples of net.sf.xbus.base.bytearraylist.ByteArrayList

    return identifierLength;
  }

  private ByteArrayList serializeList(Document doc) throws XException
  {
    ByteArrayList retArrayList = new ByteArrayList();

    ByteArrayConverter conv = ByteArrayConverterFactory
        .getConverter(mEncodingSystem);

    NodeList records = doc.getElementsByTagName(TAG_RECORD);
    Node recordNode;
    NamedNodeMap recordAttributes;
    Attr recordLengthAttr;
    int recordLength;
    byte[] recordArray;

    NodeList fields;
    Node fieldNode;
    NamedNodeMap fieldAttributes;
    Attr fieldLengthAttr;
    int fieldLength;
    Node fieldTextNode;
    String fieldValue;
    byte[] fieldBytes;
    int pos;

    for (int i = 0; i < records.getLength(); i++)
    {
      recordNode = records.item(i);
      recordAttributes = recordNode.getAttributes();
      recordLengthAttr = (Attr) recordAttributes.getNamedItem(TAG_LENGTH);
      recordLength = Integer.parseInt(recordLengthAttr.getNodeValue());
      recordArray = new byte[recordLength];

      pos = 0;

      fields = recordNode.getChildNodes();
      for (int k = 0; k < fields.getLength(); k++)
      {
        fieldNode = fields.item(k);

        if (fieldNode.getNodeType() == Node.ELEMENT_NODE)
        {
          fieldAttributes = fieldNode.getAttributes();
          fieldLengthAttr = (Attr) fieldAttributes
              .getNamedItem(TAG_LENGTH);
          fieldLength = Integer.parseInt(fieldLengthAttr
              .getNodeValue());
          fieldTextNode = fieldNode.getFirstChild();
          fieldValue = fieldTextNode.getNodeValue();
          fieldBytes = conv
              .stringToByteArray(fieldValue, fieldLength);
          for (int m = 0; m < fieldBytes.length; m++)
          {
            recordArray[pos] = fieldBytes[m];
            pos++;
          }
        }
      }
      retArrayList.add(recordArray);
    }
    return retArrayList;
  }
View Full Code Here

Examples of net.sf.xbus.base.bytearraylist.ByteArrayList

  public Object execute(String function, Object callData) throws XException
  {
    RecordFormat format = prepareWriting();

    if (callData == null)
      callData = new ByteArrayList();

    writeData(callData, mOriginFile, format);
    return null;
  }
View Full Code Here

Examples of net.sf.xbus.base.bytearraylist.ByteArrayList

   * @return <code>ByteArrayInputStream</code>
   */
  public Object transform(Object inObject, XBUSSystem source,
      XBUSSystem destination, Message destinationMessage)
  {
    ByteArrayList bal = (ByteArrayList) inObject;

    return new ByteArrayInputStream(bal.toByteArray());
  }
View Full Code Here

Examples of net.sf.xbus.base.bytearraylist.ByteArrayList

      BufferedOutputStream buffOut = new BufferedOutputStream(
          new FileOutputStream(mTempFilename[0], true));

      if (callData == null)
        callData = new ByteArrayList();

      byte[] record = null;
      Iterator it = ((ByteArrayList) callData).iterator();
      if (it.hasNext())
      {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.