向byte()添加单个字节 [英] add a single byte to byte()

查看:349
本文介绍了向byte()添加单个字节的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的不太了解字节/位等等。


问题,如果我定义了一个byte(),我该如何向它添加一个字节?


我想要的是我有一个字节数组,我循环该数组,查看该字节的

值,如果该字节是我想要什么,然后我将它插入新的字节()中。
。我怎么能这样做?


-

亲切的问候


郭启铮

guoqi AT meetholland dot com
Http://www.meetholland.com

I am really do not know so much about byte/bit, etc.

Question, if I defined a byte(), how can I add a single byte to it?

what I want is that I have an array of bytes, I loop that array, look at the
value of that individual byte, if that byte is what I want, then I insert it
into the new byte(). How can I do it?

--
Kind regards

Guoqi Zheng
guoqi AT meetholland dot com
Http://www.meetholland.com

推荐答案

redim the array - 和 -

为新元素分配一个字节


" Guoqi Zheng" < no@sorry.nl>在消息中写道

新闻:%2 **************** @ TK2MSFTNGP12.phx.gbl ...
redim the array - and -
assign a byte to the new element

"Guoqi Zheng" <no@sorry.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
我是真的不太了解字节/位等等。

问题,如果我定义了一个byte(),我该如何添加一个字节呢?

什么我想要的是我有一个字节数组,我循环该数组,看看
该单个字节的值,如果该字节是我想要的,那么我将
插入新字节( )。我该怎么办呢?

-
亲切的问候

郭国琪
guoqi AT meetholland dot com
http://www.meetholland.com
I am really do not know so much about byte/bit, etc.

Question, if I defined a byte(), how can I add a single byte to it?

what I want is that I have an array of bytes, I loop that array, look at the value of that individual byte, if that byte is what I want, then I insert it into the new byte(). How can I do it?

--
Kind regards

Guoqi Zheng
guoqi AT meetholland dot com
Http://www.meetholland.com



---

外发邮件经过无病毒认证。

由AVG反病毒系统检查( http://www.grisoft.com)

版本:6.0.754 /病毒数据库:504 - 发布日期:9 / 6/2004


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.754 / Virus Database: 504 - Release Date: 9/6/2004


*" Hal Rosser" < HM ****** @ bellsouth.net> scripsit:
* "Hal Rosser" <hm******@bellsouth.net> scripsit:
redim the array - 和 -
为新元素分配一个字节
redim the array - and -
assign a byte to the new element




在这种情况下,''ReDim保留''是要走的路。


-

MS Herfried K. Wagner

MVP< URL:http ://dotnet.mvps.org/>

VB< URL:http://dotnet.mvps.org/dotnet/faqs/>



In this case, ''ReDim Preserve'' is the way to go.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>


2004-09-08,Guoqi Zheng< no@sorry.nl>写道:
On 2004-09-08, Guoqi Zheng <no@sorry.nl> wrote:
我真的不太了解字节/位等等。

问题,如果我定义了一个byte(),我怎么能添加一个字节对它?

我想要的是我有一个字节数组,我循环该数组,看看那个字节的
值,如果那个字节是我想要的,那么我将它插入到新的byte()中。我该怎么办?
I am really do not know so much about byte/bit, etc.

Question, if I defined a byte(), how can I add a single byte to it?

what I want is that I have an array of bytes, I loop that array, look at the
value of that individual byte, if that byte is what I want, then I insert it
into the new byte(). How can I do it?




对于可调整大小的数组,你真的想使用

System.Collections.ArrayList。在你用Array

想要的内容填充ArrayList之后,你总是可以转换回一个

普通字节()。


如果你只需要一次添加一个字节,那么ReDim Preserve将会工作正常,但听起来你是在循环中这样做了,并且
$如果你在这里依赖ReDim,b $ b的表现会很糟糕。



For resizable arrays, you really want to use
System.Collections.ArrayList. You can always convert back into an
ordinary byte() after you''ve filled the ArrayList with the contents you
want.

If you only need to add a single byte one time, then ReDim Preserve will
work fine, but it sounds like you''re doing this in a loop, and
performance will be terrible if you rely on ReDim here.


这篇关于向byte()添加单个字节的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆