code
stringlengths
73
34.1k
label
stringclasses
1 value
public boolean isInstanceRunning(String clusterName) { boolean result; try { @SuppressWarnings("unchecked") Map<String, Object> response = client.get("/", Map.class); result = clusterName.equals(response.get("cluster_name")); } catch (Elast...
java
public static CommandLine buildKillCommandLine(String pid) { CommandLine command; if (SystemUtils.IS_OS_WINDOWS) { command = new CommandLine("taskkill") .addArgument("/F") .addArgument("/pid") .addArgument(pid); ...
java
public static String getElasticsearchPid(String baseDir) { try { String pid = new String(Files.readAllBytes(Paths.get(baseDir, "pid"))); return pid; } catch (IOException e) { throw new IllegalStateException( String.forma...
java
public static boolean isWindowsProcessAlive(InstanceConfiguration config, String pid) { CommandLine command = new CommandLine("tasklist") .addArgument("/FI") .addArgument("PID eq " + pid, true); List<String> output = executeScript(config, command, true); ...
java
public static Map<String, String> createEnvironment(Map<String, String> environment) { Map<String, String> result = null; try { result = EnvironmentUtils.getProcEnvironment(); } catch (IOException ex) { throw new ElasticsearchSetupExce...
java
@Override public File resolveArtifact(String coordinates) throws ArtifactException { ArtifactRequest request = new ArtifactRequest(); Artifact artifact = new DefaultArtifact(coordinates); request.setArtifact(artifact); request.setRepositories(remoteRepositories); log.deb...
java
public Future<AsperaTransaction> upload(String bucket, File localFileName, String remoteFileName) { return upload(bucket, localFileName, remoteFileName, asperaConfig, null); }
java
public AsperaTransaction processTransfer(String transferSpecStr, String bucketName, String key, String fileName, ProgressListener progressListener) { // Generate session id String xferId = UUID.randomUUID().toString(); AsperaTransactionImpl asperaTransaction = null; try { TransferProgress transferProgress...
java
public FASPConnectionInfo getFaspConnectionInfo(String bucketName) { log.trace("AsperaTransferManager.getFaspConnectionInfo >> start " + System.nanoTime()); FASPConnectionInfo faspConnectionInfo = akCache.get(bucketName); if (null == faspConnectionInfo) { log.trace("AsperaTransferManager.getFaspConnectionInf...
java
public void checkMultiSessionAllGlobalConfig(TransferSpecs transferSpecs) { if(asperaTransferManagerConfig.isMultiSession()){ for(TransferSpec transferSpec : transferSpecs.transfer_specs) { //If multisession defined as global use 'all' suffix, else check if a number has been specified transferSpec.setRem...
java
public void modifyTransferSpec(AsperaConfig sessionDetails, TransferSpecs transferSpecs) { for(TransferSpec transferSpec : transferSpecs.transfer_specs) { if (!StringUtils.isNullOrEmpty(String.valueOf(sessionDetails.getTargetRateKbps())))transferSpec.setTarget_rate_kbps(sessionDetails.getTargetRateKbps()); if (...
java
public void excludeSubdirectories(File directory, TransferSpecs transferSpecs) { if ( directory == null || !directory.exists() || !directory.isDirectory() ) { throw new IllegalArgumentException("Must provide a directory to upload"); } List<File> files = new LinkedList<File>(); listFile...
java
private void listFiles(File dir, List<File> results) { File[] found = dir.listFiles(); if ( found != null ) { for ( File f : found ) { if (f.isDirectory()) { //do nothing } else { results.add(f); } ...
java
private String updateRemoteHost(String remoteHost){ String [] splitStr = remoteHost.split("\\."); remoteHost = new StringBuilder(remoteHost).insert(splitStr[0].length(), "-all").toString(); return remoteHost; }
java
protected void checkAscpThreshold() { if (TransferListener.getAscpCount() >= asperaTransferManagerConfig.getAscpMaxConcurrent()) { log.error("ASCP process threshold has been reached, there are currently " + TransferListener.getAscpCount() + " processes running"); throw new AsperaTransferException("ASCP process...
java
@Deprecated public void setProgressListener(com.ibm.cloud.objectstorage.services.s3.model.ProgressListener progressListener) { setGeneralProgressListener(new LegacyS3ProgressListener(progressListener)); }
java
@Deprecated public com.ibm.cloud.objectstorage.services.s3.model.ProgressListener getProgressListener() { ProgressListener generalProgressListener = getGeneralProgressListener(); if (generalProgressListener instanceof LegacyS3ProgressListener) { return ((LegacyS3ProgressListener)generalP...
java
@Deprecated public GetObjectRequest withProgressListener(com.ibm.cloud.objectstorage.services.s3.model.ProgressListener progressListener) { setProgressListener(progressListener); return this; }
java
public static boolean isThrottlingException(SdkBaseException exception) { if (!isAse(exception)) { return false; } final AmazonServiceException ase = toAse(exception); return THROTTLING_ERROR_CODES.contains(ase.getErrorCode()) || ase.getStatusCode() == 429; }
java
public static boolean isRequestEntityTooLargeException(SdkBaseException exception) { return isAse(exception) && toAse(exception).getStatusCode() == HttpStatus.SC_REQUEST_TOO_LONG; }
java
public static boolean isClockSkewError(SdkBaseException exception) { return isAse(exception) && CLOCK_SKEW_ERROR_CODES.contains(toAse(exception).getErrorCode()); }
java
private static SecuredCEK secureCEK(SecretKey cek, EncryptionMaterials materials, S3KeyWrapScheme kwScheme, SecureRandom srand, Provider p, AWSKMS kms, AmazonWebServiceRequest req) { final Map<String,String> matdesc; if (materials.isKMSEnabled()) { matdes...
java
public void abort() throws IOException { /* * The abort() method of DownloadImpl would attempt to notify its * TransferStateChangeListener BEFORE it releases its intrinsic lock. * And according to the implementation of * MultipleFileTransferStateChangeListener which is a...
java
protected Request<CreateBucketRequest> addIAMHeaders(Request<CreateBucketRequest> request, CreateBucketRequest createBucketRequest){ if ((null != this.awsCredentialsProvider ) && (this.awsCredentialsProvider.getCredentials() instanceof IBMOAuthCredentials)) { if (null != createBucketRequest.getService...
java
private ContentCryptoMaterial newContentCryptoMaterial( EncryptionMaterialsProvider kekMaterialProvider, Map<String, String> materialsDescription, Provider provider, AmazonWebServiceRequest req) { EncryptionMaterials kekMaterials = kekMaterialProvider.getEncryptio...
java
private ContentCryptoMaterial newContentCryptoMaterial( EncryptionMaterialsProvider kekMaterialProvider, Provider provider, AmazonWebServiceRequest req) { EncryptionMaterials kekMaterials = kekMaterialProvider.getEncryptionMaterials(); if (kekMaterials == null) throw ...
java
public FASPConnectionInfoHandler parseFASPConnectionInfoResponse(InputStream inputStream) throws IOException { FASPConnectionInfoHandler handler = new FASPConnectionInfoHandler(); parseXmlInputStream(handler, inputStream); return handler; }
java
public void setOutputSchemaVersion(StorageClassAnalysisSchemaVersion outputSchemaVersion) { if (outputSchemaVersion == null) { setOutputSchemaVersion((String) null); } else { setOutputSchemaVersion(outputSchemaVersion.toString()); } }
java
public static S3Objects withPrefix(AmazonS3 s3, String bucketName, String prefix) { S3Objects objects = new S3Objects(s3, bucketName); objects.prefix = prefix; return objects; }
java
private static synchronized ProfileCredentialsService getProfileCredentialService() { if (STS_CREDENTIALS_SERVICE == null) { try { STS_CREDENTIALS_SERVICE = (ProfileCredentialsService) Class.forName(CLASS_NAME) .newInstance(); } catch (ClassNotFoun...
java
@Override public String getToken() { log.debug("DefaultTokenManager getToken()"); if (!checkCache()) { retrieveToken(); } // retrieve from cache if (token == null) { token = retrieveTokenFromCache(); } // check if expired if (hasTokenExpired(token)) { token = retrieveTokenFromCache(); } ...
java
protected synchronized void cacheToken(final Token token) { log.debug("OAuthTokenManager.cacheToken"); // Parse token expires in seconds. int tokenExpiresInSecs; try { tokenExpiresInSecs = Integer.parseInt(token.getExpires_in()); } catch (NumberFormatException exception) { tokenExpiresInSecs = 0; } ...
java
protected boolean hasTokenExpired(final Token token) { log.debug("OAuthTokenManager.hasTokenExpired"); final long currentTime = System.currentTimeMillis() / 1000L; if (Long.valueOf(token.getExpiration()) < currentTime) { retrieveToken(); return true; } return false; }
java
protected boolean isTokenExpiring(final Token token) { log.debug("OAuthTokenManager.isTokenExpiring"); final long currentTime = System.currentTimeMillis() / 1000L; if (currentTime > token.getRefreshTime()) { log.debug("Token is expiring"); return true; } else { log.debug("Token is not expiring." + t...
java
protected synchronized void retrieveToken() { log.debug("OAuthTokenManager.retrieveToken"); if (token == null || (Long.valueOf(token.getExpiration()) < System.currentTimeMillis() / 1000L)) { log.debug("Token is null, retrieving initial token from provider"); boolean tokenRequest = true; int retryCount =...
java
protected void submitRefreshTask() { TokenRefreshTask tokenRefreshTask = new TokenRefreshTask(iamEndpoint, this); executor.execute(tokenRefreshTask); log.debug("Submitted token refresh task"); }
java
public void setClientConfiguration(ClientConfiguration clientConfiguration) { this.clientConfiguration = clientConfiguration; if (clientConfiguration != null) { this.httpClientSettings = HttpClientSettings.adapt(clientConfiguration); if (getProvider() instanceof DefaultTokenProvider) { DefaultTokenProvide...
java
public Waiter objectNotExists() { return new WaiterBuilder<GetObjectMetadataRequest, ObjectMetadata>() .withSdkFunction(new HeadObjectFunction(client)) .withAcceptors( new HttpFailureStatusAcceptor(404, WaiterState.SUCCESS)) .withDefaultPo...
java
protected AmazonServiceException newException(String message) throws Exception { Constructor<? extends AmazonServiceException> constructor = exceptionClass.getConstructor(String.class); return constructor.newInstance(message); }
java
private boolean doesStatusMatch(String status) { return (status.equals(transferListener.getStatus(xferid)) ? true : false); }
java
@Override protected AmazonS3Encryption build(AwsSyncClientParams clientParams) { return new AmazonS3EncryptionClient( new AmazonS3EncryptionClientParamsWrapper(clientParams, resolveS3ClientOptions(), encryptionMaterials, ...
java
public void setRules(Map<String, ReplicationRule> rules) { if (rules == null) { throw new IllegalArgumentException( "Replication rules cannot be null"); } this.rules = new HashMap<String, ReplicationRule>(rules); }
java
public BucketReplicationConfiguration addRule(String id, ReplicationRule rule) { if (id == null || id.trim().isEmpty()) { throw new IllegalArgumentException( "Rule id cannot be null or empty."); } if (rule == null) { throw new IllegalArgume...
java
public static void registerSigner( final String signerType, final Class<? extends Signer> signerClass) { if (signerType == null) { throw new IllegalArgumentException("signerType cannot be null"); } if (signerClass == null) { throw new IllegalArgum...
java
private static Signer lookupAndCreateSigner(String serviceName, String regionName) { String signerType = lookUpSignerTypeByServiceAndRegion(serviceName, regionName); return createSigner(signerType, serviceName); }
java
private static Signer createSigner(String signerType, final String serviceName) { Class<? extends Signer> signerClass = SIGNERS.get(signerType); if (signerClass == null) throw new IllegalArgumentException("unknown signer type: " + signerType); Signer signer = createSigner...
java
@SdkProtectedApi public static Signer createSigner(String signerType, SignerParams params) { Signer signer = createSigner(signerType); if (signer instanceof ServiceAwareSigner) { ((ServiceAwareSigner) signer).setServiceName(params.getServiceName()); } if (signer instanc...
java
private static Signer createSigner(String signerType) { Class<? extends Signer> signerClass = SIGNERS.get(signerType); Signer signer; try { signer = signerClass.newInstance(); } catch (InstantiationException ex) { throw new IllegalStateException( ...
java
@Override public void startEvent(String eventName) { /* This will overwrite past events */ eventsBeingProfiled.put // ignoring the wall clock time (eventName, TimingInfo.startTimingFullSupport(System.nanoTime())); }
java
@Override public void endEvent(String eventName) { TimingInfo event = eventsBeingProfiled.get(eventName); /* Somebody tried to end an event that was not started. */ if (event == null) { LogFactory.getLog(getClass()).warn ("Trying to end an event which was never st...
java
public static SSECustomerKey generateSSECustomerKeyForPresignUrl( String algorithm) { if (algorithm == null) throw new IllegalArgumentException(); return new SSECustomerKey().withAlgorithm(algorithm); }
java
public List<T> unmarshall(JsonUnmarshallerContext context) throws Exception { if (context.isInsideResponseHeader()) { return unmarshallResponseHeaderToList(context); } return unmarshallJsonToList(context); }
java
private List<T> unmarshallResponseHeaderToList( JsonUnmarshallerContext context) throws Exception { String headerValue = context.readText(); List<T> list = new ArrayList<T>(); String[] headerValues = headerValue.split("[,]"); for (final String headerVal : headerValues) { ...
java
private List<T> unmarshallJsonToList(JsonUnmarshallerContext context) throws Exception { List<T> list = new ArrayList<T>(); if (context.getCurrentToken() == JsonToken.VALUE_NULL) { return null; } while (true) { JsonToken token = context.nextToken(); ...
java
public byte[] convertToXmlByteArray( RequestPaymentConfiguration requestPaymentConfiguration) { XmlWriter xml = new XmlWriter(); xml.start("RequestPaymentConfiguration", "xmlns", Constants.XML_NAMESPACE); Payer payer = requestPaymentConfiguration.getPayer(); ...
java
protected UploadPartRequest newUploadPartRequest(PartCreationEvent event, final File part) { final UploadPartRequest reqUploadPart = new UploadPartRequest() .withBucketName(req.getBucketName()) .withFile(part) .withKey(req.getKey()) .withPartNumber(eve...
java
public void setFrequency(InventoryFrequency frequency) { setFrequency(frequency == null ? (String) null : frequency.toString()); }
java
public static TransferListener getInstance(String xferId, AsperaTransaction transaction) { if(instance == null) { instance = new TransferListener(); } if(transactions.get(xferId) != null) { transactions.get(xferId).add(transaction); } else { List<AsperaTransaction> transferTransactions = new ArrayList...
java
private boolean isNewSession(String xferId, String sessionId) { List<String> currentSessions = transactionSessions.get(xferId); if(currentSessions == null) { List<String> sessions = new ArrayList<String>(); sessions.add(sessionId); transactionSessions.put(xferId, sessions); return true; } else if (!c...
java
private void removeTransactionSession(String xferId, String sessionId) { List<String> sessions = transactionSessions.get(xferId); if(sessions != null){ final boolean removal = sessions.remove(sessionId); if (removal) { ascpCount--; } } }
java
public void removeAllTransactionSessions(String xferId) { List<String> sessions = transactionSessions.get(xferId); if(sessions != null) sessions.clear(); }
java
private int numberOfSessionsInTransaction(String xferId) { int sessionCount = 0; List<String> sessions = transactionSessions.get(xferId); if(sessions != null) sessionCount = sessions.size(); return sessionCount; }
java
@SuppressWarnings("unchecked") private void startScheduler(){ scheduledExecutorService.scheduleAtFixedRate(new Runnable() { @Override @SuppressWarnings("rawtypes") public void run() { Iterator<Entry<String, Long>> it = transactionCallbackTime.entrySet().iterator(); while (it.hasNext()) { Ma...
java
public void setFormat(InventoryFormat format) { setFormat(format == null ? (String) null : format.toString()); }
java
@Override public Token retrieveToken() { log.debug("DefaultTokenProvider retrieveToken()"); try { SSLContext sslContext; /* * If SSL cert checking for endpoints has been explicitly disabled, * register a new scheme for HTTPS that won't cause self-signed * certs to error out. */ if (SDKG...
java
protected boolean needsToLoadCredentials() { if (credentials == null) return true; if (credentialsExpiration != null) { if (isWithinExpirationThreshold()) return true; } if (lastInstanceProfileCheck != null) { if (isPastRefreshThreshold()) return true; }...
java
private synchronized void fetchCredentials() { if (!needsToLoadCredentials()) return; JsonNode accessKey; JsonNode secretKey; JsonNode node; JsonNode token; try { lastInstanceProfileCheck = new Date(); String credentialsResponse = EC2CredentialsU...
java
private void handleError(String errorMessage, Exception e) { // If we don't have any valid credentials to fall back on, then throw an exception if (credentials == null || expired()) throw new SdkClientException(errorMessage, e); // Otherwise, just log the error and continuing using ...
java
public String parseErrorCode(HttpResponse response, JsonContent jsonContent) { String errorCodeFromHeader = parseErrorCodeFromHeader(response.getHeaders()); if (errorCodeFromHeader != null) { return errorCodeFromHeader; } else if (jsonContent != null) { return parseErrorC...
java
private String parseErrorCodeFromHeader(Map<String, String> httpHeaders) { String headerValue = httpHeaders.get(X_AMZN_ERROR_TYPE); if (headerValue != null) { int separator = headerValue.indexOf(':'); if (separator != -1) { headerValue = headerValue.substring(0, s...
java
public long getCRC32Checksum() { if (context == null) { return 0L; } CRC32ChecksumCalculatingInputStream crc32ChecksumInputStream = (CRC32ChecksumCalculatingInputStream)context.getAttribute(CRC32ChecksumCalculatingInputStream.class.getName()); return crc32Chec...
java
public Subclass withIAMEndpoint(String iamEndpoint) { this.iamEndpoint = iamEndpoint; if ((this.credentials.getCredentials() instanceof IBMOAuthCredentials) && ((IBMOAuthCredentials)this.credentials.getCredentials()).getTokenManager() instanceof DefaultTokenManager){ ((DefaultToken...
java
public Subclass withIAMTokenRefresh(double offset) { this.iamTokenRefreshOffset = offset; if ((offset > 0) && (this.credentials.getCredentials() instanceof IBMOAuthCredentials) && ((IBMOAuthCredentials)this.credentials.getCredentials()).getTokenManager() instanceof DefaultTokenMana...
java
public static String load() { JarFile jar = null; String location = null; try { jar = createJar(); String version = jarVersion(jar); location = EXTRACT_LOCATION_ROOT + SEPARATOR + version; File extractedLocation = new File(location); if(!extractedLocation.exists()) { extractJar(jar, extractedLo...
java
public static JarFile createJar() throws IOException, URISyntaxException { URL location = faspmanager2.class.getProtectionDomain().getCodeSource().getLocation(); return new JarFile(new File(location.toURI())); }
java
public static String jarVersion(JarFile jar) throws IOException { String version = jar.getManifest().getMainAttributes().getValue(Attributes.Name.IMPLEMENTATION_VERSION); if(version == null) { version = String.format("%d", System.currentTimeMillis()); } return version; }
java
public static void extractFile(JarFile jar, JarEntry entry, File destPath) throws IOException { InputStream in = null; OutputStream out = null; try { in = jar.getInputStream(entry); out = new FileOutputStream(destPath); byte[] buf = new byte[1024]; for (int i = in.read(buf); i != -1; i = in.r...
java
public static List<String> osLibs() { String OS = System.getProperty("os.name").toLowerCase(); if (OS.indexOf("win") >= 0){ return WINDOWS_DYNAMIC_LIBS; } else if (OS.indexOf("mac") >= 0) { return MAC_DYNAMIC_LIBS; } else if (OS.indexOf("nix") >= 0 || OS.indexOf("nux") >= 0 || OS.indexOf("aix") > 0 ) { ...
java
public static void loadLibrary(File extractedPath, List<String> candidates) { for (String lib : candidates) { File libPath = new File(extractedPath, lib); String absPath = libPath.getAbsolutePath(); log.debug("Attempting to load dynamic library: " + absPath); try { System.load(absPath); log.info("...
java
private List<PartETag> collectPartETags() { final List<PartETag> partETags = new ArrayList<PartETag>(); for (Future<PartETag> future : futures) { try { partETags.add(future.get()); } catch (Exception e) { throw new SdkClientException("Unable to copy part: " + e.getCause().getMessage(), e.getCau...
java
public AWSCredentials getCredentials() { if (credentialProvider != null) { return credentialProvider.getCredentials(); } else { credentialProvider = new JsonStaticCredentialsProvider(credentials); return credentialProvider.getCredentials(); } }
java
public String parseErrorMessage(HttpResponse httpResponse, JsonNode jsonNode) { // If X_AMZN_ERROR_MESSAGE is present, prefer that. Otherwise check the JSON body. final String headerMessage = httpResponse.getHeader(X_AMZN_ERROR_MESSAGE); if (headerMessage != null) { return headerMess...
java
private void writeBufferToFile() throws IOException { if (_bufferOffset > 0) { List<ByteBuffer> payload = new ArrayList<ByteBuffer>(1); payload.add(ByteBuffer.wrap(_buffer, 0, _bufferOffset)); NfsWriteResponse response = _nfsFile.write(_currentOffset, payload, _syncType); ...
java
private void checkRpcReply() throws RpcException { if (_replyStatus != ReplyStatus.MSG_ACCEPTED.getValue()) { String msg = String.format("RPC call is REJECTED, rejectStat=%d", _rejectStatus); throw new RpcException(RejectStatus.fromValue(_rejectStatus), msg); } else { ...
java
static void putRecordMarkingAndSend(Channel channel, Xdr rpcRequest) { // XDR header buffer List<ByteBuffer> buffers = new LinkedList<>(); buffers.add(ByteBuffer.wrap(rpcRequest.getBuffer(), 0, rpcRequest.getOffset())); // payload buffer if (rpcRequest.getPayloads() != null) { ...
java
static Xdr removeRecordMarking(byte[] bytes) { Xdr toReturn = new Xdr(bytes.length); Xdr input = new Xdr(bytes); long fragSize; boolean lastFragment = false; input.setOffset(0); int inputOff = input.getOffset(); while (!lastFragment) { fragSize = i...
java
public void marshalling(Xdr xdr) { marshalling(xdr, _mode); marshalling(xdr, _uid); marshalling(xdr, _gid); if (_size != null) { xdr.putBoolean(true); xdr.putLong(_size.longValue()); } else { xdr.putBoolean(false); } marshalling...
java
public static NfsCreateMode fromValue(int value) { NfsCreateMode createMode = VALUES.get(value); if (createMode == null) { createMode = new NfsCreateMode(value); VALUES.put(value, createMode); } return createMode; }
java
public static int queryPortFromPortMap(int program, int version, String serverIP) throws IOException { GetPortResponse response = null; GetPortRequest request = new GetPortRequest(program, version); for (int i = 0; i < _maxRetry; ++i) { try { Xdr portmapXdr = new Xdr(...
java
private static void handleRpcException(RpcException e, int attemptNumber, String server) throws IOException { String messageStart; if (!(e.getStatus().equals(RpcStatus.NETWORK_ERROR))) { messageStart = "network"; } else { // check whether to retry if (attemptN...
java
private static NfsPreOpAttributes makePreOpAttributes(Xdr xdr) { NfsPreOpAttributes preOpAttributes = null; if ((xdr != null) && xdr.getBoolean()) { preOpAttributes = new NfsPreOpAttributes(xdr); } return preOpAttributes; }
java
private static NfsGetAttributes makeAttributes(Xdr xdr) { NfsGetAttributes attributes = null; if (xdr != null) { attributes = NfsResponseBase.makeNfsGetAttributes(xdr); } return attributes; }
java
public void putInt(int i) { _buffer[_offset++] = (byte) (i >>> 24); _buffer[_offset++] = (byte) (i >> 16); _buffer[_offset++] = (byte) (i >> 8); _buffer[_offset++] = (byte) i; }
java
public void putUnsignedInt(long i) { _buffer[_offset++] = (byte) (i >>> 24 & 0xff); _buffer[_offset++] = (byte) (i >> 16); _buffer[_offset++] = (byte) (i >> 8); _buffer[_offset++] = (byte) i; }
java
public long getLong() { return ((long) (_buffer[_offset++] & 0xff) << 56 | (long) (_buffer[_offset++] & 0xff) << 48 | (long) (_buffer[_offset++] & 0xff) << 40 | (long) (_buffer[_offset++] & 0xff) << 32 | (long) (_buffer[_offset++] & 0xff) << 24 | (long) (_buffer[_offset++] & 0xff...
java
public void putLong(long i) { _buffer[_offset++] = (byte) (i >>> 56); _buffer[_offset++] = (byte) ((i >> 48) & 0xff); _buffer[_offset++] = (byte) ((i >> 40) & 0xff); _buffer[_offset++] = (byte) ((i >> 32) & 0xff); _buffer[_offset++] = (byte) ((i >> 24) & 0xff); _buffer[_o...
java
public String getString() { int len = getInt(); String s = new String(_buffer, _offset, len, RpcRequest.CHARSET); skip(len); return s; }
java
public byte[] getByteArray() { int lengthToCopy = getInt(); byte[] byteArray = (lengthToCopy == 0) ? null : new byte[lengthToCopy]; getBytes(lengthToCopy, byteArray, 0); return byteArray; }
java
public void getBytes(int lengthToCopy, byte[] copyArray, int copyOffset) { if (lengthToCopy > 0) { System.arraycopy(_buffer, _offset, copyArray, copyOffset, lengthToCopy); skip(lengthToCopy); } }
java
public void putByteArray(byte[] b, int boff, int len) { putInt(len); putBytes(b, boff, len); }
java