我搜索了InputStream
和Reader
之间的差异。我得到了回答。
InputStream: Byte-Base(逐字节读取)
读者:字符库(由char读取char)
我将á
字符粘贴到我的操作系统中的ASCII(或可能是其他字符集)为225的文件中,并且字节max_value
为127.我使用{{ 1}}只是读取()然后为什么它返回225?它如何读取多个字节?因为FileInputStream
方法一次只能读取一个字节或字符。
或read()
和InputStream
之间的实际区别是什么?
答案 0 :(得分:1)
á
确实有一个225的unicode值(它的代码点,与其编码无关)。当你把它转换成一个字节时,你得到-31。但是,如果您仔细查看InputStream.read的文档,您会看到:
从输入流中读取下一个数据字节。 值字节作为int返回,范围为0到255.
(强调添加)read
方法返回 int ,而不是字节,但该int实际上表示无符号字节。如果将该int转换为char,您将返回á
。如果将该int转换为一个字节,它将包装到-31。
更详细一点:
á
的unicode值为225。00000000 11100001
11100001
。如果将其视为有符号字节,则其值为-31;如果将其视为无符号,则其值为225。InputStream.read
返回一个int,以便它可以将流的结尾表示为-1。但是如果int是非负的,那么只设置它的底部8位(十进制值0-255)11100001
答案 1 :(得分:0)
InputStream.read()
返回一个int。 That is a value between 0
and 255
.
Byte.MAX_VALUE
为127
,Byte.MIN_VALUE
为-128
,为二进制10000000
。但java不支持无符号基元,因此最重要的字节始终是符号位。
答案 2 :(得分:0)
区别在于InputStream
将按原样读取文件的内容,没有解释:原始字节。
另一方面,Reader
将使用CharsetDecoder
来处理字节输入,并将其转换为char
s的序列。它处理字节输入的方式取决于使用的Charset
。
这不是1< - > 1关系!
另外,忘记“ASCII值”; Java不使用ASCII,它使用Unicode,而char
实际上是UTF-16代码单元。当Java开始时它是一个完整的代码点,但随后Unicode定义了BMP之外的代码点,Java必须适应:U + FFFF上的代码点现在使用代理对来表示,即两个字符。
有关更详细的说明,请参阅here。
答案 3 :(得分:-1)
不完全是关于主题的,但是您已经达到了Java限制,即没有未签名的本机类型。
在C / C ++中,byte可以是0..255或-127..127。
在Java中,选择了签名的Process: Python [3609] Path: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python Identifier: Python Version: 2.7.10 (2.7.10) Code Type: X86-64 (Native) Parent Process: ??? [3604] Responsible: Python [3609] User ID: 503
Date/Time: 2016-03-30 17:58:26.469 +0200 OS Version: Mac OS X 10.11.3 (15D21) Report Version: 11 Anonymous UUID: F829ADA5-2D7E-CDCB-4599-4A9C227DE9C5
Time Awake Since Boot: 3400 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY
VM Regions Near 0:
-->
__TEXT 000000010fd24000-000000010fd25000 [ 4K] r-x/rwx SM=COW /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 ??? 000000000000000000 0 + 0 1 libpython2.7.dylib 0x0000000110e7fb17 PyEval_GetGlobals + 23 2 libpython2.7.dylib 0x0000000110ea3da2 PyImport_Import + 50 3 libpython2.7.dylib 0x0000000110ea3fd8 PyImport_ImportModule + 40 4 matlabengineforpython2_7.so 0x000000011053dcf7 initmatlabengineforpython2_7 + 23 5 org.python.python 0x000000010fdc44b3 _PyImport_LoadDynamicModule + 140 6 org.python.python 0x000000010fdc31b1 0x10fd29000 + 631217 7 org.python.python 0x000000010fdc2d77 0x10fd29000 + 630135 8 org.python.python 0x000000010fdc1f5b PyImport_ImportModuleLevel + 1139 9 org.python.python 0x000000010fda7a0a 0x10fd29000 + 518666 10 org.python.python 0x000000010fdafa0b PyEval_EvalFrameEx + 13400 11 org.python.python 0x000000010fdac3c1 PyEval_EvalCodeEx + 1583 12 org.python.python 0x000000010fdb24ae 0x10fd29000 + 562350 13 org.python.python 0x000000010fdaf30c PyEval_EvalFrameEx + 11609 14 org.python.python 0x000000010fdac3c1 PyEval_EvalCodeEx + 1583 15 org.python.python 0x000000010fdabd8c PyEval_EvalCode + 54 16 org.python.python 0x000000010fdc0a37 PyImport_ExecCodeModuleEx + 241 17 org.python.python 0x000000010fdc374f 0x10fd29000 + 632655 18 org.python.python 0x000000010fdc39d4 0x10fd29000 + 633300 19 org.python.python 0x000000010fdc31b1 0x10fd29000 + 631217 20 org.python.python 0x000000010fdc2d77 0x10fd29000 + 630135 21 org.python.python 0x000000010fdc1f93 PyImport_ImportModuleLevel + 1195 22 org.python.python 0x000000010fda7a0a 0x10fd29000 + 518666 23 org.python.python 0x000000010fd33202 PyObject_Call + 99 24 org.python.python 0x000000010fdb1e83 PyEval_CallObjectWithKeywords + 165 25 org.python.python 0x000000010fdae2ec PyEval_EvalFrameEx + 7481 26 org.python.python 0x000000010fdac3c1 PyEval_EvalCodeEx + 1583 27 org.python.python 0x000000010fdabd8c PyEval_EvalCode + 54 28 org.python.python 0x000000010fdcba42 0x10fd29000 + 666178 29 org.python.python 0x000000010fdcbae5 PyRun_FileExFlags + 133 30 org.python.python 0x000000010fdcb634 PyRun_SimpleFileExFlags + 698 31 org.python.python 0x000000010fddd011 Py_Main + 3137 32 libdyld.dylib 0x00007fff8d4725ad start + 1
Thread 1: 0 libsystem_kernel.dylib 0x00007fff88c8d6de
__workq_kernreturn + 10 1 libsystem_pthread.dylib 0x00007fff884f7729 _pthread_wqthread + 1283 2 libsystem_pthread.dylib 0x00007fff884f5365 start_wqthread + 13
Thread 2:: Dispatch queue: com.apple.libdispatch-manager 0 libsystem_kernel.dylib 0x00007fff88c8dff6 kevent_qos + 10 1 libdispatch.dylib 0x00007fff8e105099 _dispatch_mgr_invoke
+ 216 2 libdispatch.dylib 0x00007fff8e104d01 _dispatch_mgr_thread + 52
Thread 3: 0 libsystem_kernel.dylib 0x00007fff88c8d6de
__workq_kernreturn + 10 1 libsystem_pthread.dylib 0x00007fff884f7729 _pthread_wqthread + 1283 2 libsystem_pthread.dylib 0x00007fff884f5365 start_wqthread + 13
Thread 4: 0 libsystem_kernel.dylib 0x00007fff88c8d6de
__workq_kernreturn + 10 1 libsystem_pthread.dylib 0x00007fff884f7729 _pthread_wqthread + 1283 2 libsystem_pthread.dylib 0x00007fff884f5365 start_wqthread + 13
Thread 0 crashed with X86 Thread State (64-bit): rax: 0x0000000110f68540 rbx: 0x0000000113829030 rcx: 0x0000000000000008 rdx: 0x00000001138290c0 rdi: 0x0000000000000000 rsi: 0x0000000000000000 rbp: 0x00007fff4feda420 rsp: 0x00007fff4feda418 r8: 0x0000000110eaad4c r9: 0x0000000110f7f0b0 r10: 0x0000000000000000 r11: 0x000000000294015c r12: 0x0000000000000000 r13: 0x0000000000000000 r14: 0x0000000113829030 r15: 0x000000010fe613f8 rip: 0x0000000000000000 rfl: 0x0000000000010206 cr2: 0x0000000000000000 Logical CPU: 3 Error Code: 0x00000014 Trap Number: 14
Binary Images:
0x10fd24000 - 0x10fd24fff org.python.python (2.7.10 - 2.7.10) <C517A5DB-2554-3B18-B185-056F652B2F55> /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
0x10fd29000 - 0x10fe1aff7 org.python.python (2.7.10 - 2.7.10) <ABBA93BD-FB4A-34EB-8362-650D0FF6C1A1> /System/Library/Frameworks/Python.framework/Versions/2.7/Python
0x1101e3000 - 0x1101e4fff _locale.so (94) <6C7EB7F6-222C-3BE7-8D65-B9DCBD8931FF> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_locale.so
0x110269000 - 0x11026cfff operator.so (94) <1A0F7C26-2E64-3EBB-BEC8-44F96DA05FFC> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/operator.so
0x110273000 - 0x110275fff _collections.so (94) <D7112DEC-DD54-37AF-8D00-135B06649B77> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_collections.so
0x11027c000 - 0x110280fff itertools.so (94) <49860150-735A-3C9B-996B-9B1E9D310EC8> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/itertools.so
0x11028a000 - 0x11028bfff _heapq.so (94) <23E666D1-0260-30E3-8291-A68C641F1171> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_heapq.so
0x1102d1000 - 0x1102e0fff _io.so (94) <6FDA36F1-9F87-35BF-8D82-4A2303236D3F> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
0x1102f1000 - 0x1102f4ff7 math.so (94) <1637540A-A769-3732-8C50-9BE3E0455636> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/math.so
0x1102fb000 - 0x1102fdfff binascii.so (94) <5F4A49D3-3606-3A95-836E-0D75915C72B9> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/binascii.so
0x110302000 - 0x110303fff _hashlib.so (94) <CFB92476-1544-3B3F-8366-5B389B21A235> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_hashlib.so
0x110309000 - 0x11030cfff _struct.so (94) <62E94AB5-0016-33B1-A67C-3170776EC19D> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_struct.so
0x110313000 - 0x110314ff7 _random.so (94) <E9434EBB-9BB4-3960-A1FB-D9029D7BAEAB> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_random.so
0x110319000 - 0x11031afff cStringIO.so (94) <575AABB8-95E5-3D71-961E-D7609D0E860A> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/cStringIO.so
0x110320000 - 0x110321fff fcntl.so (94) <86FEA0C2-CD20-399E-B4DB-2678042BB0AA> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/fcntl.so
0x110326000 - 0x110327ff7 time.so (94) <36B871D5-4881-3ACE-B4B0-ADB6151F938C> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/time.so
0x11036e000 - 0x110371ff7 strop.so (94) <1D059A80-5692-3A3E-8085-44E6761CC4A2> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/strop.so
0x110377000 - 0x11037eff7 _socket.so (94) <81DD00EE-9A93-3617-AF7A-57ECAF4363BE> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_socket.so
0x110389000 - 0x11038afff _functools.so (94) <98357790-1F0D-39B3-8F10-54B90B973529> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_functools.so
0x11038f000 - 0x110398fff _ssl.so (94) <199B2179-BD39-305A-9224-4C22EF916DD0> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ssl.so
0x110424000 - 0x110424fff _scproxy.so (94) <BBC0BFC5-0CB4-35C5-86DC-DD02D596535C> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_scproxy.so
0x1104e9000 - 0x1104edfff array.so (94) <18437978-86DB-387E-887D-9B130168981F> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/array.so
0x110534000 - 0x110557ff8 +matlabengineforpython2_7.so (0) <5C149CA8-A359-3955-AB38-6174FE929864> /Applications/MATLAB_R2015b.app/extern/engines/python/dist/matlab/engine/maci64/matlabengineforpython2_7.so
0x110575000 - 0x11068aff2 +libmx.dylib (0) <E1C01B4F-0E77-3E72-8405-740BFFCB3346> /Applications/MATLAB_R2015b.app/bin/maci64/libmx.dylib
0x110706000 - 0x1107d5ffa +libmwfl.dylib (0) <F0669917-1751-380B-9DE9-9E1EAFFB3C7E> /Applications/MATLAB_R2015b.app/bin/maci64/libmwfl.dylib
0x1108ca000 - 0x110939ff1 +libmwi18n.dylib (0) <7C560066-6954-37FE-A248-E109E838E078> /Applications/MATLAB_R2015b.app/bin/maci64/libmwi18n.dylib
0x110983000 - 0x1109a0ff5 +libmwengine_api.dylib (0) <4F494FDF-3B37-309B-B74C-D17DF239C450> /Applications/MATLAB_R2015b.app/bin/maci64/libmwengine_api.dylib
0x1109ba000 - 0x110b08ffe +libmwmlutil.dylib (0) <FAE9071E-7D39-3333-B03A-9FA549879AD0> /Applications/MATLAB_R2015b.app/bin/maci64/libmwmlutil.dylib
0x110dad000 - 0x110db7ff7 +libmwcpp11compat.dylib (0) <ADFE9039-E706-3826-B321-57B530C94012> /Applications/MATLAB_R2015b.app/bin/maci64/libmwcpp11compat.dylib
0x110dc6000 - 0x110f36ff7 +libpython2.7.dylib (2.7) <54D8DBAC-FF5C-0D3A-A11A-6419EBC941C3> /Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
0x111006000 - 0x111053ffd +libut.dylib (0) <75124867-D829-3468-A71B-A51F3DD9E893> /Applications/MATLAB_R2015b.app/bin/maci64/libut.dylib
0x1110a7000 - 0x111109ff7 +libboost_log.dylib (0) <265AF1D4-38CF-3988-95A7-4DAB30FD78F9> /Applications/MATLAB_R2015b.app/bin/maci64/libboost_log.dylib
0x1111a9000 - 0x1111b5ffa +libboost_thread.dylib (0) <E3546590-F780-314D-8232-F7F500EE96F2> /Applications/MATLAB_R2015b.app/bin/maci64/libboost_thread.dylib
0x1111c9000 - 0x1112cdffb +libicuuc.54.dylib (0) <C2291C1B-BA99-3F89-8AE0-D82C304F22E3> /Applications/MATLAB_R2015b.app/bin/maci64/libicuuc.54.dylib
0x11132f000 - 0x11134cff7 +libtbb.dylib (0) <7E612A1E-6A0A-368D-A249-7BC6F8F1D09F> /Applications/MATLAB_R2015b.app/bin/maci64/libtbb.dylib
0x111361000 - 0x11136efff +libtbbmalloc.dylib (0) <92A6DC41-82A3-3F6E-A2CB-C251D24C93CE> /Applications/MATLAB_R2015b.app/bin/maci64/libtbbmalloc.dylib
0x111398000 - 0x111398ffd +libmwresource_core.dylib (0) <0682ECBD-6C67-330E-8692-26ADDC0D82D8> /Applications/MATLAB_R2015b.app/bin/maci64/libmwresource_core.dylib
0x11139b000 - 0x1113abff3 +libboost_filesystem.dylib (0) <ACE643E6-0555-33B5-B5B5-4E169777D944> /Applications/MATLAB_R2015b.app/bin/maci64/libboost_filesystem.dylib
0x1113bd000 - 0x1113beff7 +libboost_system.dylib (0) <6BC301FC-1026-3D5D-A644-D9308E2135FE> /Applications/MATLAB_R2015b.app/bin/maci64/libboost_system.dylib
0x1113c1000 - 0x1113dafff libexpat.1.dylib (12.20.1) <AA76E4CF-52F5-3CF9-907B-FBB80BAFB125> /usr/lib/libexpat.1.dylib
0x1113e4000 - 0x11154affb +libicui18n.54.dylib (0) <441B83B5-CD28-3677-9AF2-246ACB4DA620> /Applications/MATLAB_R2015b.app/bin/maci64/libicui18n.54.dylib
0x111610000 - 0x111617ffb +libicuio.54.dylib (0) <81462A69-BABB-34D3-8E0A-4EA7471A8393> /Applications/MATLAB_R2015b.app/bin/maci64/libicuio.54.dylib
0x11161e000 - 0x112e49fff +libicudata.54.dylib (0) <B9C8B350-AB40-3429-A96B-1BCB68982646> /Applications/MATLAB_R2015b.app/bin/maci64/libicudata.54.dylib
0x112e4b000 - 0x112f5dfe7 +libcrypto.1.0.0.dylib (0) <5605229A-1B87-34ED-81AE-C9B4710FE073> /Applications/MATLAB_R2015b.app/bin/maci64/libcrypto.1.0.0.dylib
0x112fce000 - 0x112fd2ff5 +libboost_date_time.dylib (0) <E9678FDC-5B38-37B6-B377-8D633D2273B4> /Applications/MATLAB_R2015b.app/bin/maci64/libboost_date_time.dylib
0x112fde000 - 0x113088ff9 +libboost_regex.dylib (0) <86331A42-3EAC-3E7F-92A3-0CB64FA2D2BF> /Applications/MATLAB_R2015b.app/bin/maci64/libboost_regex.dylib
0x1130f9000 - 0x11311eff8 +libboost_serialization.dylib (0) <37AFC49A-512B-3B0D-B1A4-BDA4FAAD5A06> /Applications/MATLAB_R2015b.app/bin/maci64/libboost_serialization.dylib
0x113186000 - 0x113191ff1 +libboost_signals.dylib (0) <43065B1E-95E0-3B06-9A51-E0F9B20514D6> /Applications/MATLAB_R2015b.app/bin/maci64/libboost_signals.dylib
0x11319f000 - 0x11327effb +libmwmvm.dylib (0) <6808E810-B93E-38CD-8415-0EA652997400> /Applications/MATLAB_R2015b.app/bin/maci64/libmwmvm.dylib
0x113417000 - 0x113598ffd +libmwms.dylib (0) <D7CC156B-159C-3540-A524-3A852F698459> /Applications/MATLAB_R2015b.app/bin/maci64/libmwms.dylib
0x1137fd000 - 0x113807ff3 +libboost_iostreams.dylib (0) <0A2B5ABE-CE27-370B-89C4-154257FD6C52> /Applications/MATLAB_R2015b.app/bin/maci64/libboost_iostreams.dylib
0x7fff6ceef000 - 0x7fff6cf26007 dyld (360.19) <9D05FDF4-65CE-3B53-86D4-ABE1A5BF35F3> /usr/lib/dyld
0x7fff86336000 - 0x7fff86338ff7 libquarantine.dylib (80) <163CF63A-7455-3D1F-AE57-8C4475A9204C> /usr/lib/system/libquarantine.dylib
0x7fff86def000 - 0x7fff86e50ff7 libsystem_network.dylib (583.20.10) <865FE79A-A22D-3733-A14F-FC7B37F3AECD> /usr/lib/system/libsystem_network.dylib
0x7fff86e82000 - 0x7fff86ee0fff com.apple.SystemConfiguration (1.14 - 1.14) <5A70115B-E346-3EBD-A617-9A11C61EEF2E> /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
0x7fff87669000 - 0x7fff87671fff libcopyfile.dylib (127) <F5133269-0B22-388C-A57C-079667B6291E> /usr/lib/system/libcopyfile.dylib
0x7fff884f4000 - 0x7fff884fdff7 libsystem_pthread.dylib (138.10.4) <327CECD0-B881-3153-8FCC-4FD4818B7F16> /usr/lib/system/libsystem_pthread.dylib
0x7fff88bb2000 - 0x7fff88bb9ff7 libcompiler_rt.dylib (62) <D3C4AB40-23B4-3BC6-8C38-5B8758D14E80> /usr/lib/system/libcompiler_rt.dylib
0x7fff88c76000 - 0x7fff88c94fff libsystem_kernel.dylib (3248.30.4) <9CEB6C3B-1CAF-3C32-A9FD-93BC72CBCEA1> /usr/lib/system/libsystem_kernel.dylib
0x7fff89192000 - 0x7fff89193fff com.apple.TrustEvaluationAgent (2.0 - 25) <0239494E-FEFE-39BC-9FC7-E251BA5128F1> /System/Library/PrivateFrameworks/TrustEvaluationAgent.framework/Versions/A/TrustEvaluationAgent
0x7fff89477000 - 0x7fff894bdff7 libauto.dylib (186) <999E610F-41FC-32A3-ADCA-5EC049B65DFB> /usr/lib/libauto.dylib
0x7fff89596000 - 0x7fff89597fff libsystem_secinit.dylib (20) <FD6ECF2C-1489-32CA-981B-9045B5EB1FAA> /usr/lib/system/libsystem_secinit.dylib
0x7fff896bc000 - 0x7fff898c9ffb libicucore.A.dylib (551.41) <CFFD7342-A7D6-323A-AC14-B9EECF6EFFED> /usr/lib/libicucore.A.dylib
0x7fff89bf8000 - 0x7fff89c14ff7 libsystem_malloc.dylib (67) <9EECAB18-F025-34C4-8E32-7EFFA6720EFC> /usr/lib/system/libsystem_malloc.dylib
0x7fff89c15000 - 0x7fff89cfcff7 libcrypto.0.9.8.dylib (59) <ED1C2A26-8FFC-30FF-8726-FF952EF94ADF> /usr/lib/libcrypto.0.9.8.dylib
0x7fff8a22b000 - 0x7fff8a23cff7 libz.1.dylib (61.20.1) <B3EBB42F-48E3-3287-9F0D-308E04D407AC> /usr/lib/libz.1.dylib
0x7fff8a39d000 - 0x7fff8a3a8ff7 libcommonCrypto.dylib (60075.20.1) <766BC3F5-41F3-3315-BABC-72718A98EA92> /usr/lib/system/libcommonCrypto.dylib
0x7fff8a3d4000 - 0x7fff8a3d4ff7 libkeymgr.dylib (28) <09397E01-6066-3179-A50C-2CE666FDA929> /usr/lib/system/libkeymgr.dylib
0x7fff8a60e000 - 0x7fff8a637fff libsystem_info.dylib (477.20.1) <6513635B-4ADE-3B45-BF63-ED7AC565B0C9> /usr/lib/system/libsystem_info.dylib
0x7fff8b4e7000 - 0x7fff8b574fff libsystem_c.dylib (1082.20.4) <EAB38A6C-8671-3B13-B500-90EC1B912063> /usr/lib/system/libsystem_c.dylib
0x7fff8ca97000 - 0x7fff8ca99ff7 libsystem_configuration.dylib (802.20.7) <5FD79070-36CC-3D02-BEA7-BB5D2AE97D5D> /usr/lib/system/libsystem_configuration.dylib
0x7fff8d46f000 - 0x7fff8d472ffb libdyld.dylib (360.19) <AA629043-C6F6-32FE-8007-E3478E99ACA7> /usr/lib/system/libdyld.dylib
0x7fff8d4c6000 - 0x7fff8d53dfe7 libcorecrypto.dylib (335.20.1) <C6BD205F-4ECE-37EE-BCAB-A76F39CDCFFA> /usr/lib/system/libcorecrypto.dylib
0x7fff8db17000 - 0x7fff8db20ff3 libsystem_notify.dylib (150.20.3) <243FADE1-255A-3B78-8033-F336CD64B817> /usr/lib/system/libsystem_notify.dylib
0x7fff8dcde000 - 0x7fff8dcdfffb libSystem.B.dylib (1226.10.1) <5A4257EF-3145-3BB3-87A4-0D2404A9462D> /usr/lib/libSystem.B.dylib
0x7fff8dd33000 - 0x7fff8dd44ff7 libsystem_trace.dylib (201.10.3) <B485369F-E3A1-319E-998C-89AAF606079E> /usr/lib/system/libsystem_trace.dylib
0x7fff8e0fd000 - 0x7fff8e12afff libdispatch.dylib (501.20.1) <324C9189-2AF3-3356-847F-6F4CE1C6E901> /usr/lib/system/libdispatch.dylib
0x7fff8eef6000 - 0x7fff8f36cfff com.apple.CoreFoundation (6.9 - 1256.14) <768A7FB7-9143-3148-8591-7C6ED3162D35> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x7fff8fe50000 - 0x7fff8fe58ffb libsystem_dnssd.dylib (625.20.4) <945B5FB1-DA91-3D45-A961-A8FAD53C1E7E> /usr/lib/system/libsystem_dnssd.dylib
0x7fff9032c000 - 0x7fff90362fff libssl.0.9.8.dylib (59) <DC4B66A8-AFED-33A9-A5B8-D2088C6EF5B2> /usr/lib/libssl.0.9.8.dylib
0x7fff90525000 - 0x7fff90528ff7 libsystem_sandbox.dylib (460.30.1) <3E0036AF-FC64-3352-8DA4-6B550C2C2562> /usr/lib/system/libsystem_sandbox.dylib
0x7fff90693000 - 0x7fff90694ffb libremovefile.dylib (41) <B8D1A5FC-CFD5-3AAB-8A10-14DDC129710A> /usr/lib/system/libremovefile.dylib
0x7fff906e2000 - 0x7fff906e3fff libDiagnosticMessagesClient.dylib (100) <4243B6B4-21E9-355B-9C5A-95A216233B96> /usr/lib/libDiagnosticMessagesClient.dylib
0x7fff90b18000 - 0x7fff90b2fff7 libsystem_asl.dylib (322.30.1) <9B500E4E-E462-321E-828E-5524DC984C1B> /usr/lib/system/libsystem_asl.dylib
0x7fff914ff000 - 0x7fff91528fff libxpc.dylib (756.20.4) <61AB4610-9304-354C-9E9B-D57198AE9866> /usr/lib/system/libxpc.dylib
0x7fff91d2e000 - 0x7fff91d44ff7 libsystem_coretls.dylib (83.20.8) <75C97D88-0A63-3093-AE83-DE33EB7405CE> /usr/lib/system/libsystem_coretls.dylib
0x7fff925e3000 - 0x7fff925e8ff7 libmacho.dylib (875.1) <CB745E1F-4885-3F96-B38B-2093DF488FD5> /usr/lib/system/libmacho.dylib
0x7fff92613000 - 0x7fff9263cfff libc++abi.dylib (125) <DCCC8177-3D09-35BC-9784-2A04FEC4C71B> /usr/lib/libc++abi.dylib
0x7fff92756000 - 0x7fff92758fff libsystem_coreservices.dylib (19.2) <1B3F5AFC-FFCD-3ECB-8B9A-5538366FB20D> /usr/lib/system/libsystem_coreservices.dylib
0x7fff931ea000 - 0x7fff93555657 libobjc.A.dylib (680) <58CB8CFC-7DBD-3A53-BD72-A42FF799B21E> /usr/lib/libobjc.A.dylib
0x7fff93921000 - 0x7fff93950ffb libsystem_m.dylib (3105) <26655445-CA97-321E-B221-801CB378D1AA> /usr/lib/system/libsystem_m.dylib
0x7fff9691a000 - 0x7fff9696dff7 libc++.1.dylib (120.1) <8FC3D139-8055-3498-9AC5-6467CB7F4D14> /usr/lib/libc++.1.dylib
0x7fff96b11000 - 0x7fff96b12fff libsystem_blocks.dylib (65) <49D42329-7DE9-3413-92C3-A473A7E9CF35> /usr/lib/system/libsystem_blocks.dylib
0x7fff96b79000 - 0x7fff96b81fff libsystem_networkextension.dylib (385.20.6) <DC8A102A-BF02-31A4-8914-65C34DF6B592> /usr/lib/system/libsystem_networkextension.dylib
0x7fff98fb8000 - 0x7fff98fc0fe7 libsystem_platform.dylib (74.10.3) <D3A27E10-7F08-3603-ACC8-7A92B2C04BAB> /usr/lib/system/libsystem_platform.dylib
0x7fff99f55000 - 0x7fff99f55ff7 liblaunch.dylib (756.20.4) <EDF719D6-D2BB-38DD-8C94-4272BEFDA2CD> /usr/lib/system/liblaunch.dylib
0x7fff9a50d000 - 0x7fff9a511fff libcache.dylib (75) <6B245C0A-F3EA-383B-A542-5B0D0456A41B> /usr/lib/system/libcache.dylib
0x7fff9a512000 - 0x7fff9a512ff7 libunc.dylib (29) <1D0F8265-F026-3CBD-93D3-F8DF14FFCE68> /usr/lib/system/libunc.dylib
0x7fff9bda0000 - 0x7fff9bda5ff3 libunwind.dylib (35.3) <124E0F05-2350-3774-A32C-7F5BF38EDE73> /usr/lib/system/libunwind.dylib
0x7fff9c829000 - 0x7fff9c839fff libbsm.0.dylib (34) <7E14504C-A8B0-3574-B6EB-5D5FABC72926> /usr/lib/libbsm.0.dylib
External Modification Summary: Calls made by other processes targeting this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0 Calls made by this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0 Calls made by all processes on this machine:
task_for_pid: 2381
thread_create: 0
thread_set_state: 0
VM Region Summary: ReadOnly portion of Libraries: Total=157.6M resident=0K(0%) swapped_out_or_unallocated=157.6M(100%) Writable regions: Total=62.4M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=62.4M(100%)
VIRTUAL REGION REGION TYPE SIZE COUNT (non-coalesced)
=========== ======= ======= Activity Tracing 2048K 2 Dispatch continuations 8192K 2 Kernel Alloc Once 4K 2 MALLOC
37.4M 11 MALLOC guard page 16K 4 Process Corpse Info 2048K 2 STACK GUARD
56.0M 6 Stack 9824K 6 VM_ALLOCATE 2836K 10
__DATA 5300K 113
__LINKEDIT 103.2M 54
__TEXT 54.4M 101
__UNICODE 552K 2 shared memory 28K 6
=========== ======= ======= TOTAL 281.2M 307
Model: MacBookPro9,2, BootROM MBP91.00D3.B0C, 2 processors, Intel Core i7, 2.9 GHz, 8 GB, SMC 2.2f41 Graphics: Intel HD Graphics 4000, Intel HD Graphics 4000, Built-In Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54333531533643465238432D50422020 Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54333531533643465238432D50422020 AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0xF5), Broadcom BCM43xx 1.0 (7.21.94.136.1a1) Bluetooth: Version 4.4.3f4 16616, 3 services, 27 devices, 1 incoming serial ports Network Service: Wi-Fi, AirPort, en1 Serial ATA Device: Samsung SSD 840 EVO 120GB, 120.03 GB Serial ATA Device: APPLE HDD HTS547575A9E384, 750.16 GB USB Device: USB 2.0 Bus USB Device: Hub USB Device: FaceTime HD Camera (Built-in) USB Device: USB 2.0 Bus USB Device: Hub USB Device: Hub USB Device: Apple Internal Keyboard / Trackpad USB Device: IR Receiver USB Device: BRCM20702 Hub USB Device: Bluetooth USB Host Controller USB Device: USB 3.0 Bus Thunderbolt Bus: MacBook Pro, Apple Inc., 25.1
。
因此,为了在java中表示无符号byte
,我们必须转到下一个更高的算术类型byte
。
当然,同样适用于无符号int
。要在Java中查看超过2G的值,您必须拥有int
。