Home
last modified time | relevance | path

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

12345

/tools/tradefederation/core/javatests/com/android/tradefed/util/
DStreamUtilTest.java48 final byte[] contentBytes = contents.getBytes(); in testGetByteArrayListFromSource()
68 final byte[] contentBytes = contents.getBytes(); in testGetByteArrayListFromStream()
86 try (InputStreamSource source = new ByteArrayInputStreamSource(contents.getBytes())) { in testGetStringFromSource()
101 try (InputStreamSource source = new ByteArrayInputStreamSource(contents.getBytes())) { in testGetBufferedReaderFromInputStream()
118 final InputStreamSource source = new ByteArrayInputStreamSource(contents.getBytes()); in testCountLinesFromSource()
130 new ByteArrayInputStream(contents.getBytes())); in testGetStringFromStream()
142 StreamUtil.getStringFromStream(new ByteArrayInputStream(contents.getBytes()), 5); in testGetStringFromStream_withLength()
156 ByteArrayInputStream inputSource = new ByteArrayInputStream(source.getBytes()); in testCalculateCrc32()
171 ByteArrayInputStream inputSource = new ByteArrayInputStream(source.getBytes()); in testCalculateMd5()
186 ByteArrayInputStream inputSource = new ByteArrayInputStream(source.getBytes()); in testCalculateBase64Md5()
[all …]
DFixedByteArrayOutputStreamTest.java56 mOutStream.write(text.getBytes()); in writeTextIntoStreamAndReturn()
104 mOutStream.write(prefix.getBytes()); in testWriteWithWrap()
118 mOutStream.write(text.getBytes(), offset, text.length() - offset); in testLessThanBufferWithOffset()
138 mOutStream.write(prefix.getBytes()); in testWriteWithOffsetAndWrap()
139 mOutStream.write(followup.getBytes(), offset, followup.length() - offset); in testWriteWithOffsetAndWrap()
DFileUtilTest.java205 FileUtil.writeToFile(new ByteArrayInputStream("write1".getBytes()), testFile, false); in testWriteToFile_overwrites_exists()
207 FileUtil.writeToFile(new ByteArrayInputStream("write2".getBytes()), testFile, false); in testWriteToFile_overwrites_exists()
223 FileUtil.writeToFile(new ByteArrayInputStream("write1".getBytes()), testFile, true); in testWriteToFile_appends_exists()
224 FileUtil.writeToFile(new ByteArrayInputStream("write2".getBytes()), testFile, true); in testWriteToFile_appends_exists()
241 FileUtil.writeToFile(new ByteArrayInputStream("write1".getBytes()), testFile, false); in testWriteToFile_overwrites_doesNotExist()
258 FileUtil.writeToFile(new ByteArrayInputStream("write1".getBytes()), testFile, true); in testWriteToFile_appends_doesNotExist()
271 FileUtil.writeToFile(new ByteArrayInputStream("write1".getBytes()), testFile); in testWriteToFile_stream_overwrites()
273 FileUtil.writeToFile(new ByteArrayInputStream("write2".getBytes()), testFile); in testWriteToFile_stream_overwrites()
DGCSFileUploaderFuncTest.java71 InputStream uploadFileStream = new ByteArrayInputStream(FILE_DATA.getBytes()); in testUploadFile_roundTrip()
84 InputStream uploadFileStream = new ByteArrayInputStream(FILE_DATA.getBytes()); in testUploadFile_overwrite()
DBugreportTest.java62 InputStream name = new ByteArrayInputStream(bugreport.getName().getBytes()); in setUp()
64 InputStream content = new ByteArrayInputStream(BUGREPORT_CONTENT.getBytes()); in setUp()
158 InputStream content = new ByteArrayInputStream(BUGREPORT_CONTENT.getBytes()); in testBugreportz_noMainFile()
DLogcatEventParserTest.java172 receiver.addOutput(output.getBytes(), 0, output.getBytes().length); in testEndToEnd()
/tools/apksig/src/test/java/com/android/apksig/internal/util/
DChainedDataSourceTest.java42 DataSources.asDataSource(ByteBuffer.wrap("12".getBytes(US_ASCII))), in setUp()
43 DataSources.asDataSource(ByteBuffer.wrap("34567".getBytes(US_ASCII))), in setUp()
44 DataSources.asDataSource(ByteBuffer.wrap("".getBytes(US_ASCII))), in setUp()
45 DataSources.asDataSource(ByteBuffer.wrap("890".getBytes(US_ASCII))), in setUp()
46 DataSources.asDataSource(ByteBuffer.wrap("".getBytes(US_ASCII)))); in setUp()
57 ByteBuffer.wrap("1234567890".substring(begin, end).getBytes(US_ASCII)), in feedAllPossibleRanges()
74 ByteBuffer.wrap("1234567890".substring(begin, end).getBytes(US_ASCII)), in getByteBufferFromAllPossibleRanges()
96 ByteBuffer.wrap("1234567890".substring(begin, end).getBytes(US_ASCII)), in copyTo()
110 ByteBuffer.wrap("1234567890".substring(begin, end).getBytes(US_ASCII)), in slice()
/tools/test/graphicsbenchmark/performance_tests/helper/test/com/android/game/qualification/
DGameCoreConfigurationXmlParserTest.java56 + "</game-core>\n").getBytes())) { in testSingleApkInfo()
96 + "</game-core>\n").getBytes())) { in testOptionalFields()
128 + " </game-core>\n").getBytes())) { in testMissingRequiredField()
155 + "</game-core>\n").getBytes())) { in testApkWithArguments()
193 + "</game-core>\n").getBytes())) { in testRequirements()
217 + " </game-core>\n").getBytes())) { in testRequirementNeedsMatchingApk()
/tools/tradefederation/core/javatests/com/android/tradefed/device/
DMockTestDeviceHelper.java46 byte[] inputData = response.getBytes(); in injectShellResponse()
57 byte[] inputData = response.getBytes(); in injectShellResponse()
91 byte[] inputData = response.getBytes(); in injectShellResponse()
108 byte[] inputData = response.getBytes(); in injectShellResponse()
/tools/tradefederation/core/javatests/com/android/tradefed/cache/
DMerkleTreeTest.java55 DigestCalculator.compute("buzz".getBytes(UTF_8)), in buildMerkleTree()
60 DigestCalculator.compute("fizzbuzz".getBytes(UTF_8)), in buildMerkleTree()
68 DigestCalculator.compute("bar".getBytes(UTF_8)), in buildMerkleTree()
73 DigestCalculator.compute("foo".getBytes(UTF_8)), in buildMerkleTree()
/tools/tradefederation/core/javatests/com/android/tradefed/result/
DDeviceFileReporterTest.java98 mDfrIss = new ByteArrayInputStreamSource(tombstone.getBytes()); in testSimple()
122 mDfrIss = new ByteArrayInputStreamSource(tombstone.getBytes()); in testTrim()
151 mDfrIss = new ByteArrayInputStreamSource(tombstone.getBytes()); in testLine_containingSpace()
187 mDfrIss = new ByteArrayInputStreamSource(tombstone.getBytes()); in testLineEnding_LF()
219 mDfrIss = new ByteArrayInputStreamSource(tombstone.getBytes()); in testLineEnding_CRLF()
252 final InputStreamSource pngIss = new ByteArrayInputStreamSource(pngContents.getBytes()); in testRepeat_skip()
253 final InputStreamSource xmlIss = new ByteArrayInputStreamSource(xmlContents.getBytes()); in testRepeat_skip()
305 final InputStreamSource pngIss = new ByteArrayInputStreamSource(pngContents.getBytes()); in testRepeat_noSkip()
306 final InputStreamSource xmlIss = new ByteArrayInputStreamSource(xmlContents.getBytes()); in testRepeat_noSkip()
393 mDfrIss = new ByteArrayInputStreamSource(tombstone.getBytes()); in testTwoFiles()
[all …]
DLogFileSaverTest.java157 ByteArrayInputStream mockInput = new ByteArrayInputStream(testData.getBytes()); in testSaveLogData()
183 ByteArrayInputStream mockInput = new ByteArrayInputStream(testData.getBytes()); in testSaveAndGZipLogData()
221 ByteArrayInputStream mockInput = new ByteArrayInputStream(testData.getBytes()); in testCreateAndGZipLogData()
244 ByteArrayInputStream mockInput = new ByteArrayInputStream(testData.getBytes()); in testSaveLogDataRaw()
268 ByteArrayInputStream mockInput = new ByteArrayInputStream(testData.getBytes()); in testSaveLogDataRaw_png()
DLogcatCrashResultForwarderTest.java60 .thenReturn(new ByteArrayInputStreamSource("".getBytes())); in testCaptureTestCrash_noCrashInLogcat()
100 .thenReturn(new ByteArrayInputStreamSource(logcat.getBytes())); in testCaptureTestCrash_oneCrashingLogcat()
162 .thenReturn(new ByteArrayInputStreamSource(logcat.getBytes())); in testCaptureTestCrash_oneCrashingLogcatAfterTestEnded()
210 .thenReturn(new ByteArrayInputStreamSource(logcat.getBytes())); in testCaptureTestCrash_duplicateStack()
/tools/tradefederation/core/javatests/com/android/tradefed/postprocessor/
DBasePostProcessorTest.java115 new ByteArrayInputStreamSource(TEST_DATA_NAME.getBytes())); in processTestMetricsAndLogs()
147 new ByteArrayInputStreamSource(RUN_DATA_NAME.getBytes())); in processRunMetricsAndLogs()
186 new ByteArrayInputStreamSource(ALL_DATA_NAME.getBytes())); in processAllTestMetricsAndLogs()
204 new ByteArrayInputStreamSource(TEST_DATA_NAME.getBytes())); in onTestEnd()
213 new ByteArrayInputStreamSource(RUN_DATA_NAME.getBytes())); in onTestRunEnd()
317 new ByteArrayInputStreamSource("run-log-1".getBytes())); in testRunLogsPostProcessing_processRunLogs()
352 new ByteArrayInputStreamSource("test-log-1".getBytes())); in testRunLevelPostProcessing_processRunLogsOnly()
357 new ByteArrayInputStreamSource("run-log-1".getBytes())); in testRunLevelPostProcessing_processRunLogsOnly()
362 new ByteArrayInputStreamSource("test-log-2".getBytes())); in testRunLevelPostProcessing_processRunLogsOnly()
367 new ByteArrayInputStreamSource("run-log-2".getBytes())); in testRunLevelPostProcessing_processRunLogsOnly()
[all …]
/tools/test/graphicsbenchmark/performance_tests/hostside/src/com/android/game/qualification/metric/
DHistogram.java115 output.write("<".getBytes(StandardCharsets.UTF_8)); in plotAscii()
118 output.write(">".getBytes(StandardCharsets.UTF_8)); in plotAscii()
121 output.write(" ".getBytes(StandardCharsets.UTF_8)); in plotAscii()
136 cumulative * 100f / total) .getBytes()); in plotAscii()
/tools/tradefederation/core/javatests/com/android/tradefed/device/metric/
DLogcatOnFailureCollectorTest.java98 return LOGCAT_MOCK_CONTENT.getBytes(); in createLegacyCollectingReceiver()
133 .thenReturn(new ByteArrayInputStreamSource("aaa".getBytes()));
136 .thenReturn(new ByteArrayInputStreamSource(LOGCAT_MOCK_CONTENT.getBytes()));
228 new ByteArrayInputStreamSource("aaa".getBytes()),
229 new ByteArrayInputStreamSource("aaa".getBytes()));
233 new ByteArrayInputStreamSource(LOGCAT_MOCK_CONTENT.getBytes()),
234 new ByteArrayInputStreamSource(LOGCAT_MOCK_CONTENT.getBytes()));
/tools/apkzlib/src/test/java/com/android/tools/build/apkzlib/sign/
DJarSigningTest.java82 new ByteArrayInputStream("useless text".getBytes(Charsets.US_ASCII))); in signJarWithPrexistingSimpleTextFilePre18()
136 zf1.add("directory/file", new ByteArrayInputStream("useless text".getBytes( in signJarWithPrexistingSimpleTextFilePos18()
218 byte[] file1Contents = "I am a test file".getBytes(Charsets.US_ASCII); in v1ReSignOnFileChange()
251 file1Contents = "I am a modified test file".getBytes(Charsets.US_ASCII); in v1ReSignOnFileChange()
276 file1Contents = "I have changed again!".getBytes(Charsets.US_ASCII); in v1ReSignOnFileChange()
312 byte[] fileContents = "Very interesting contents".getBytes(Charsets.US_ASCII); in openSignedJarDoesNotForcesWriteIfSignatureIsNotCorrect()
344 fileContents = "Not so interesting contents".getBytes(Charsets.US_ASCII); in openSignedJarDoesNotForcesWriteIfSignatureIsNotCorrect()
/tools/tradefederation/core/javatests/com/android/tradefed/cache/remote/
DByteStreamDownloaderTest.java76 Digest digest = DigestCalculator.compute(blob.getBytes(UTF_8)); in downloadBlob_works()
100 DigestCalculator.compute("not found blob".getBytes(UTF_8)), in downloadBlob_works()
129 downloader.downloadBlob(DigestCalculator.compute(blob.getBytes(UTF_8)), out); in downloadBlob_ignore_error_after_fully_downloaded()
/tools/tradefederation/core/javatests/com/android/tradefed/testtype/suite/
DTestSuiteStub.java102 new ByteArrayInputStreamSource("test".getBytes())); in testAttempt()
117 new ByteArrayInputStreamSource("test".getBytes())); in testAttempt()
131 new ByteArrayInputStreamSource("test".getBytes())); in testAttempt()
140 new ByteArrayInputStreamSource("test".getBytes())); in testAttempt()
/tools/tradefederation/core/javatests/com/android/tradefed/util/zip/
DCentralDirectoryInfoTest.java48 byte[] nameBytes = TEST_FILE_NAME.getBytes(UTF_8); in createCentralDirectoryData()
49 byte[] commentBytes = TEST_FILE_HEADER_COMMENT.getBytes(UTF_8); in createCentralDirectoryData()
50 byte[] contentBytes = TEST_FILE_CONTENT.getBytes(UTF_8); in createCentralDirectoryData()
/tools/apkzlib/src/test/java/com/android/tools/build/apkzlib/zip/
DAlignmentTest.java54 byte testBytes[] = "This is some text.".getBytes(Charsets.US_ASCII); in addAlignedFile()
70 byte testBytes[] = "This is some text.".getBytes(Charsets.US_ASCII); in addNonAlignedFile()
85 byte testBytes0[] = "Text number 1".getBytes(Charsets.US_ASCII);
86 byte testBytes1[] = "Text number 2, which is actually 1".getBytes(Charsets.US_ASCII);
130 byte testBytes0[] = "Text number 1".getBytes(Charsets.US_ASCII);
131 byte testBytes1[] = "Text number 2, which is actually 1".getBytes(Charsets.US_ASCII);
172 byte testBytes[] = "This is some text.".getBytes(Charsets.US_ASCII);
198 byte testBytes0[] = "Text number 1".getBytes(Charsets.US_ASCII);
199 byte testBytes1[] = "Text number 2, which is actually 1".getBytes(Charsets.US_ASCII);
/tools/apksig/src/test/java/com/android/apksig/
DApkVerifierTest.java1888 RSA_2048_CERT_SHA256_DIGEST.getBytes(StandardCharsets.UTF_8));
1890 RSA_2048_CHUNKED_SHA256_DIGEST.getBytes(StandardCharsets.UTF_8));
1894 RSA_2048_CERT_SHA256_DIGEST.getBytes(StandardCharsets.UTF_8));
1896 RSA_2048_CHUNKED_SHA256_DIGEST.getBytes(StandardCharsets.UTF_8));
1905 RSA_2048_CERT_SHA256_DIGEST.getBytes(StandardCharsets.UTF_8));
1907 RSA_2048_CHUNKED_SHA256_DIGEST.getBytes(StandardCharsets.UTF_8));
1911 RSA_2048_CERT_SHA256_DIGEST.getBytes(StandardCharsets.UTF_8));
1914 .getBytes(StandardCharsets.UTF_8));
1923 RSA_2048_CHUNKED_SHA256_DIGEST.getBytes(StandardCharsets.UTF_8));
1927 RSA_2048_CERT_SHA256_DIGEST.getBytes(StandardCharsets.UTF_8));
[all …]
/tools/tradefederation/core/test_framework/com/android/tradefed/targetprep/
DNativeLeakCollector.java98 new ByteArrayInputStreamSource(receiver.getOutput().getBytes()); in tearDown()
108 byte[] msgBytes = msg.getBytes(); in writeToReceiver()
/tools/apksig/src/test/java/com/android/apksig/util/
DDataSinkTestBase.java50 byte[] input = "abcdefg".getBytes(StandardCharsets.UTF_8); in testConsumeFromArray()
78 ByteBuffer input = ByteBuffer.wrap("abcdefg".getBytes(StandardCharsets.UTF_8)); in testConsumeFromByteBuffer()
/tools/tradefederation/core/aoa_helper/src/com/android/helper/aoa/
DAoaDevice.java63 private static final byte[] MANUFACTURER = "Android\0".getBytes(Charsets.UTF_8);
64 private static final byte[] MODEL = (AoaDevice.class.getName() + "\0").getBytes(Charsets.UTF_8);
65 private static final byte[] VERSION = "1.0\0".getBytes(Charsets.UTF_8);

12345