Home
last modified time | relevance | path

Searched refs:getBytes (Results 1 – 25 of 282) sorted by relevance

12345678910>>...12

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/
DCertificatesToPlayWith.java76 "-----END CERTIFICATE-----\n").getBytes();
106 "-----END CERTIFICATE-----\n").getBytes();
137 "-----END CERTIFICATE-----\n").getBytes();
169 "-----END CERTIFICATE-----\n").getBytes();
199 "-----END CERTIFICATE-----\n").getBytes();
229 "-----END CERTIFICATE-----\n").getBytes();
261 "-----END CERTIFICATE-----\n").getBytes();
292 "-----END CERTIFICATE-----\n").getBytes();
322 "-----END CERTIFICATE-----\n").getBytes();
354 "-----END CERTIFICATE-----\n").getBytes();
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/
DDatagramPacketTest.java37 DatagramPacket dp = new DatagramPacket("Hello".getBytes(), 5); in test_Constructor$BI()
57 DatagramPacket dp = new DatagramPacket("Hello".getBytes(), 2, 3); in test_Constructor$BII()
69 DatagramPacket dp = new DatagramPacket("Hello".getBytes(), 2, 3, in test_Constructor$BIILjava_net_InetAddressI()
82 DatagramPacket dp = new DatagramPacket("Hello".getBytes(), 5, in test_Constructor$BILjava_net_InetAddressI()
94 DatagramPacket dp = new DatagramPacket("Hello".getBytes(), 5, in test_getAddress()
104 DatagramPacket dp = new DatagramPacket("Hello".getBytes(), 5); in test_getData()
113 DatagramPacket dp = new DatagramPacket("Hello".getBytes(), 5); in test_getLength()
121 DatagramPacket dp = new DatagramPacket("Hello".getBytes(), 3, 2); in test_getOffset()
129 DatagramPacket dp = new DatagramPacket("Hello".getBytes(), 5, in test_getPort()
152 DatagramPacket dp = new DatagramPacket("Hello".getBytes(), 5, in test_setAddressLjava_net_InetAddress()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
DByteArrayOutputStreamTest.java94 bos.write(fileString.getBytes(), 0, 100); in test_reset()
104 bos.write(fileString.getBytes(), 0, 100); in test_size()
115 byte[] sbytes = fileString.getBytes(); in test_toByteArray()
117 bos.write(fileString.getBytes(), 0, fileString.length()); in test_toByteArray()
130 bos.write(fileString.getBytes("UTF-8"), 0, fileString.length()); in test_toStringLjava_lang_String()
135 bos.write(fileString.getBytes("UTF-8"), 0, fileString.length()); in test_toStringLjava_lang_String()
145 bos.write(fileString.getBytes(), 0, fileString.length()); in test_toString()
156 bos.write(fileString.getBytes(), 0, fileString.length()); in test_toStringI()
177 bos.write(fileString.getBytes(), 0, 100); in test_write$BII()
203 bos.write(fileString.getBytes(), 0, 100); in test_writeToLjava_io_OutputStream()
DPushbackInputStreamTest.java66 .getBytes())); in test_ConstructorLjava_io_InputStream()
67 pis.unread("He".getBytes()); in test_ConstructorLjava_io_InputStream()
82 .getBytes()), 5); in test_ConstructorLjava_io_InputStreamI()
83 pis.unread("Hellos".getBytes()); in test_ConstructorLjava_io_InputStreamI()
113 .available() == fileString.getBytes().length); in test_available()
134 .getBytes("UTF-8")[0]); in test_read()
227 .getBytes("UTF-8")[0]); in test_unreadI()
242 .getBytes("UTF-8")), 65535); in setUp()
DSequenceInputStreamTest.java58 InputStream is = new ByteArrayInputStream(s1.getBytes("UTF-8")); in test_Constructor_LInputStreamLInputStream_Null()
74 streams[0] = new ByteArrayInputStream(s1.getBytes("UTF-8")); in test_ConstructorLjava_util_Enumeration()
75 streams[1] = new ByteArrayInputStream(s2.getBytes("UTF-8")); in test_ConstructorLjava_util_Enumeration()
183 si = new SequenceInputStream(new ByteArrayInputStream(s1.getBytes("UTF-8")), in setUp()
184 new ByteArrayInputStream(s2.getBytes("UTF-8"))); in setUp()
/libcore/luni/src/test/java/libcore/java/lang/
DStringTest.java96 s.getBytes(EVIL_CHARSET); in testGetBytes_MaliciousCharset()
104 byte[] bytes = "xa\u0666bx".getBytes("UTF-8"); in testString_BII()
109 byte[] bytes = "xa\u0666bx".getBytes("UTF-8"); in testString_BIIString()
114 byte[] bytes = "xa\u0666bx".getBytes("UTF-8"); in testString_BIICharset()
119 byte[] bytes = "a\u0666b".getBytes("UTF-8"); in testString_BCharset()
136 assertEquals("[97, 63, 98]", Arrays.toString("a\u0666b".getBytes("US-ASCII"))); in test_getBytes_bad()
137 … assertEquals("[97, 63, 98]", Arrays.toString("a\u0666b".getBytes(Charset.forName("US-ASCII")))); in test_getBytes_bad()
145 assertEquals("[]", Arrays.toString("".getBytes(cs))); in test_getBytes_UTF_8()
148 assertEquals("[0]", Arrays.toString("\u0000".getBytes(cs))); in test_getBytes_UTF_8()
149 assertEquals("[127]", Arrays.toString("\u007f".getBytes(cs))); in test_getBytes_UTF_8()
[all …]
/libcore/ojluni/src/test/java/lang/String/CompactString/
DCompactString.java144 protected static final byte[] BYTE_ARRAY_UDUPLICATE = getBytes(STRING_UDUPLICATE);
153 protected static final byte[] BYTE_ARRAY_U1 = getBytes(STRING_U1);
158 protected static final byte[] BYTE_ARRAY_U2 = getBytes(STRING_U2);
163 protected static final byte[] BYTE_ARRAY_MDUPLICATE1 = getBytes(STRING_MDUPLICATE1);
170 protected static final byte[] BYTE_ARRAY_MDUPLICATE2 = getBytes(STRING_MDUPLICATE2);
179 protected static final byte[] BYTE_ARRAY_MLONG1 = getBytes(STRING_MLONG1);
188 protected static final byte[] BYTE_ARRAY_MLONG2 = getBytes(STRING_MLONG2);
197 protected static final byte[] BYTE_ARRAY_M11 = getBytes(STRING_M11);
202 protected static final byte[] BYTE_ARRAY_M12 = getBytes(STRING_M12);
207 protected static final byte[] BYTE_ARRAY_SUPPLEMENTARY = getBytes(STRING_SUPPLEMENTARY);
[all …]
/libcore/support/src/test/java/org/apache/harmony/testframework/
DSinkTester.java49 public abstract byte[] getBytes() throws Exception; in getBytes() method in SinkTester
99 assertArrayEquals(expected, getBytes()); in sinkTestNoWriting()
112 assertArrayEquals(expected, getBytes()); in sinkTestWriteZeroBytes()
124 assertArrayEquals(expected, getBytes()); in sinkTestWriteByteByByte()
146 assertArrayEquals(expected, getBytes()); in sinkTestWriteArray()
177 assertArrayEquals(expected, getBytes()); in sinkTestWriteOffset()
188 assertArrayEquals(expected, getBytes()); in sinkTestWriteLargeArray()
204 assertArrayEquals(expectedBytes, getBytes()); in sinkTestWriteAfterClose()
/libcore/luni/src/test/java/libcore/java/io/
DOldPushbackInputStreamTest.java37 .getBytes())); in test_ConstructorLjava_io_InputStream()
38 pis.unread("He".getBytes()); in test_ConstructorLjava_io_InputStream()
49 ByteArrayInputStream bas = new ByteArrayInputStream("Hello".getBytes()); in test_ConstructorLjava_io_InputStreamI()
65 pis.unread("Hello world".getBytes()); in test_ConstructorLjava_io_InputStreamI()
121 fileString.getBytes()[0], pis.read()); in test_read()
126 byte[] buf = ("01234567890123456789").getBytes(); in test_read$BII()
168 byte[] buf = ("01234567890123456789").getBytes(); in test_skipJ()
204 byte[] buf2 = str2.getBytes(); in test_unread$B()
244 byte[] buf2 = (str2 + str2 + str2).getBytes(); in test_unread$BII()
327 .getBytes()[0]); in test_unreadI()
[all …]
DOldPipedOutputStreamTest.java161 out.write(testString.getBytes(), 0, 10); in test_flush()
172 out.write(testString.getBytes(), 0, 5); in test_write$BII()
181 out.write(testString.getBytes(), -1, 10); in test_write$BII()
188 out.write(testString.getBytes(), 0, -1); in test_write$BII()
195 out.write(testString.getBytes(), 5, testString.length()); in test_write$BII()
206 out.write(testString.getBytes(), 0, testString.length()); in test_write$BII()
216 out.write(testString.getBytes(), 0, 5); in test_write$BII()
DOldAndroidBufferedInputStreamTest.java33 ByteArrayInputStream aa = new ByteArrayInputStream(str.getBytes()); in testBufferedInputStream()
34 ByteArrayInputStream ba = new ByteArrayInputStream(str.getBytes()); in testBufferedInputStream()
35 ByteArrayInputStream ca = new ByteArrayInputStream(str.getBytes()); in testBufferedInputStream()
36 ByteArrayInputStream da = new ByteArrayInputStream(str.getBytes()); in testBufferedInputStream()
37 ByteArrayInputStream ea = new ByteArrayInputStream(str.getBytes()); in testBufferedInputStream()
DOldBufferedOutputStreamTest.java42 os.write(fileString.getBytes(), 0, 500); in test_ConstructorLjava_io_OutputStream()
60 os.write(fileString.getBytes(), 0, 500); in test_ConstructorLjava_io_OutputStreamI()
69 os.write(fileString.getBytes(), 0, 500); in test_flush()
90 os.write(fileString.getBytes(), 0, 500); in test_write$BII()
98 os.write(fileString.getBytes(), 500, 513); in test_write$BII()
112 os.write(fileString.getBytes(), 0, 500); in test_write$BII()
DOldAndroidByteArrayInputStreamTest.java33 ByteArrayInputStream a = new ByteArrayInputStream(str.getBytes()); in testByteArrayInputStream()
34 ByteArrayInputStream b = new ByteArrayInputStream(str.getBytes()); in testByteArrayInputStream()
35 ByteArrayInputStream c = new ByteArrayInputStream(str.getBytes()); in testByteArrayInputStream()
36 ByteArrayInputStream d = new ByteArrayInputStream(str.getBytes()); in testByteArrayInputStream()
/libcore/ojluni/src/test/java/util/zip/
DDeflaterDictionaryTests.java90 byte[] input = SRC_DATA.getBytes(UTF_8); in testByteArray()
96 … deflater.setDictionary(DICTIONARY.getBytes(UTF_8), dictionary_offset, DICTIONARY_LENGTH); in testByteArray()
111 … inflater.setDictionary(DICTIONARY.getBytes(UTF_8), dictionary_offset, DICTIONARY_LENGTH); in testByteArray()
136 byte[] input = SRC_DATA.getBytes(UTF_8); in testHeapByteBuffer()
138 …ByteBuffer dictDef = ByteBuffer.wrap(DICTIONARY.getBytes(UTF_8), DICTIONARY_OFFSET, DICTIONARY_LEN… in testHeapByteBuffer()
139 …ByteBuffer dictInf = ByteBuffer.wrap(DICTIONARY.getBytes(UTF_8), DICTIONARY_OFFSET, DICTIONARY_LEN… in testHeapByteBuffer()
184 byte[] input = SRC_DATA.getBytes(UTF_8); in testByteBufferDirect()
188 dictDef.put(DICTIONARY.getBytes(UTF_8)); in testByteBufferDirect()
189 dictInf.put(DICTIONARY.getBytes(UTF_8)); in testByteBufferDirect()
239 byte[] dictionary = DICTIONARY.getBytes(UTF_8); in testInvalidOffsets()
/libcore/luni/src/test/java/libcore/java/net/
DOldDatagramPacketTest.java28 … DatagramPacket dp = new DatagramPacket("Hello".getBytes(), 5, InetAddress.getLocalHost(), 1000); in test_getPort()
63 new DatagramPacket("Hello".getBytes(), 6); in test_setLengthI()
69 new DatagramPacket("Hello".getBytes(), -1); in test_setLengthI()
76 DatagramPacket dp = new DatagramPacket("Hello".getBytes(), 5); in test_setData$BII()
85 DatagramPacket dp = new DatagramPacket("Hello".getBytes(), 5); in test_setData$B()
/libcore/ojluni/src/main/java/java/lang/
DProcessEnvironment.java161 public byte[] getBytes() { in getBytes() method in ProcessEnvironment.ExternalData
171 && arrayEquals(getBytes(), ((ExternalData) o).getBytes()); in equals()
175 return arrayHash(getBytes()); in hashCode()
191 return new Variable(str, str.getBytes()); in valueOfQueryOnly()
204 return arrayCompare(getBytes(), variable.getBytes()); in compareTo()
224 return new Value(str, str.getBytes()); in valueOfQueryOnly()
237 return arrayCompare(getBytes(), value.getBytes()); in compareTo()
298 count += entry.getKey().getBytes().length; in toEnvironmentBlock()
299 count += entry.getValue().getBytes().length; in toEnvironmentBlock()
306 byte[] key = entry.getKey ().getBytes(); in toEnvironmentBlock()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/
DString2Test.java58 assertTrue("Failed to create string", new String(hw1.getBytes()) in test_Constructor$B()
79 assertTrue("Failed to create string", new String(hw1.getBytes(), 0, hw1 in test_Constructor$BII()
80 .getBytes().length).equals(hw1)); in test_Constructor$BII()
352 byte[] sbytes = hw1.getBytes(); in test_getBytes()
367 result = string.getBytes("8859_1"); in test_getBytes()
381 result = string.getBytes("UTF8"); in test_getBytes()
431 "Hello World".getBytes(6, 11, buf, 0); in test_getBytesII$BI()
435 "Hello World".getBytes(-1, 1, null, 0); in test_getBytesII$BI()
448 byte[] buf = "Hello World".getBytes(); in test_getBytesLjava_lang_String()
452 "string".getBytes("8849_1"); in test_getBytesLjava_lang_String()
[all …]
/libcore/ojluni/src/test/java/util/Base64/
DBase64GetEncoderTest.java47 final Base64.Encoder encoder = Base64.getMimeEncoder(maxlen, "$$$".getBytes(US_ASCII)); in main()
61 .getBytes(US_ASCII); in testWrapEncode2()
87 .getBytes(US_ASCII); in testEncodeToStringWithLongInputData()
104 final byte[] bytesIn = "fo".getBytes(US_ASCII); in testWrapEncode1()
125 final byte[] bytesIn = "fo".getBytes(US_ASCII); in testEncodeToString()
/libcore/luni/src/test/java/libcore/dalvik/system/
DBlockGuardTest.java114 fos.write("01234567890".getBytes()); in testFileInputStream()
200 fos.write("a".getBytes()); in testUnbufferedIO()
221 ras.read("a".getBytes()); in testUnbufferedIO()
232 ras.write("a".getBytes()); in testUnbufferedIO()
234 ras.read("a".getBytes()); in testUnbufferedIO()
247 ras.read("a".getBytes()); in testUnbufferedIO()
256 ras.write("a".getBytes()); in testUnbufferedIO()
267 ras.read("a".getBytes()); in testUnbufferedIO()
269 ras.write("a".getBytes()); in testUnbufferedIO()
280 ras.write("a".getBytes()); in testUnbufferedIO()
/libcore/luni/src/test/java/libcore/java/nio/channels/
DFileChannelTest.java91 fc.write(ByteBuffer.wrap("abcdABCD".getBytes("US-ASCII"))); in test_readv()
113 buffers[0].put("abcd".getBytes("US-ASCII")).flip(); in test_writev()
114 buffers[1].put("ABCD".getBytes("US-ASCII")).flip(); in test_writev()
126 fc.write(ByteBuffer.wrap("hello".getBytes("US-ASCII"))); in test_append()
131 fc.write(ByteBuffer.wrap(" world".getBytes("US-ASCII"))); in test_append()
138 byte[] initialBytes = "12345".getBytes("US-ASCII"); in test_position_writeAddsPadding()
147 byte[] newBytes = "6789A".getBytes("US-ASCII"); in test_position_writeAddsPadding()
158 byte[] initialBytes = "12345".getBytes("US-ASCII"); in test_truncate_greaterThanSizeWithPositionChange()
180 byte[] initialBytes = "123456789A".getBytes("US-ASCII"); in test_truncate_greaterThanSizeWithoutPositionChange()
200 byte[] initialBytes = "123456789A".getBytes("US-ASCII"); in test_truncate_lessThanSizeWithPositionChange()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/zip/
DZipOutputStreamTest.java77 zos.write("Hello World".getBytes("UTF-8")); in test_closeEntry()
90 zos.write("Hello World".getBytes()); in test_finish()
113 zos.write("Hello World".getBytes()); in test_putNextEntryLjava_util_zip_ZipEntry()
156 zos.write(data.getBytes()); in test_setLevelI()
161 zos.write(data.getBytes()); in test_setLevelI()
173 tempCrc.update(data.getBytes()); in test_setMethodI()
177 zos.write(data.getBytes()); in test_setMethodI()
182 zos.write(data.getBytes()); in test_setMethodI()
197 zos.write(data.getBytes()); in test_write$BII()
316 zos.write(data.getBytes()); in test_timeSerializationRounding()
[all …]
DInflaterTest.java795 byte[] input = inputString.getBytes("UTF-8"); in test_getBytesRead()
823 byte[] input = inputString.getBytes("UTF-8"); in test_getBytesWritten()
895 defDict1.setDictionary(dictionary1.getBytes()); in testSetDictionary$B()
896 defDict2.setDictionary(dictionary2.getBytes()); in testSetDictionary$B()
898 defDictNo.setInput(inputString.getBytes()); in testSetDictionary$B()
899 defDict1.setInput(inputString.getBytes()); in testSetDictionary$B()
900 defDict2.setInput(inputString.getBytes()); in testSetDictionary$B()
965 infl1.setDictionary(dictionary1.getBytes()); in testSetDictionary$B()
974 infl2.setDictionary(dictionary2.getBytes()); in testSetDictionary$B()
984 infl1.setDictionary(dictionary1.getBytes()); in testSetDictionary$B()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DPropertyResourceBundleTest.java46 "p1=one\ncharset=iso-8859-1".getBytes("ISO-8859-1")); in test_ConstructorLjava_io_InputStream()
53 .getBytes("UTF-8")); in test_ConstructorLjava_io_InputStream()
76 .getBytes("ISO-8859-1"))); in test_ConstructorLjava_io_Reader()
86 cbuffer = charset.decode(ByteBuffer.wrap(content.getBytes("UTF-8"))); in test_ConstructorLjava_io_Reader()
151 "p1=one\np2=two".getBytes("ISO-8859-1")); in setUp()
183 "p3=three\np4=four".getBytes()); in test_access$0_Enumeration()
DPropertiesTest.java225 prop.load(new ByteArrayInputStream("=".getBytes())); in test_loadLjava_io_InputStream()
233 prop.load(new ByteArrayInputStream(" = ".getBytes())); in test_loadLjava_io_InputStream()
241 prop.load(new ByteArrayInputStream(" a= b".getBytes())); in test_loadLjava_io_InputStream()
249 prop.load(new ByteArrayInputStream(" a b".getBytes())); in test_loadLjava_io_InputStream()
258 .getBytes("ISO8859_1"))); in test_loadLjava_io_InputStream()
269 .getBytes("ISO8859_1"))); in test_loadLjava_io_InputStream()
329 prop.load(new ByteArrayInputStream("=".getBytes())); in test_loadLjava_io_Reader()
333 prop.load(new ByteArrayInputStream(" = ".getBytes())); in test_loadLjava_io_Reader()
337 prop.load(new ByteArrayInputStream(" a= b".getBytes())); in test_loadLjava_io_Reader()
341 prop.load(new ByteArrayInputStream(" a b".getBytes())); in test_loadLjava_io_Reader()
[all …]
/libcore/luni/src/test/java/tests/security/cert/
DPKIXBuilderParametersTest.java240 .getBytes()); in testPKIXBuilderParametersKeyStoreCertSelector04()
243 .getBytes()); in testPKIXBuilderParametersKeyStoreCertSelector04()
271 .getBytes()); in testGetMaxPathLength()
274 .getBytes()); in testGetMaxPathLength()
299 .getBytes()); in testSetMaxPathLength()
302 .getBytes()); in testSetMaxPathLength()
342 .getBytes()); in testToString()
345 .getBytes()); in testToString()

12345678910>>...12