public static <T> T[] copyOf(final T[] iSource, final int iNewSize) { return (T[]) copyOf(iSource, iNewSize, iSource.getClass()); }
public byte[] getAsByteArrayFixed(final int iSize) throws IOException { if (position >= length) return null; final byte[] portion = OArrays.copyOfRange(buffer, position, position + iSize); position += iSize; return portion; }
final ConsoleParameter annotation = (ConsoleParameter) paramAnn[annNum]; if (annotation.optional()) commandWords = OArrays.copyOf(commandWords, commandWords.length + 1); break; methodArgs = OArrays.copyOfRange(commandWords, commandWordCount, commandWords.length);
@Override public Set<OClass> getClassesRelyOnCluster(String clusterName) { getDatabase().checkSecurity(ORule.ResourceGeneric.SCHEMA, ORole.PERMISSION_READ); final int clusterId = getDatabase().getClusterIdByName(clusterName); final Set<OClass> result = new HashSet<OClass>(); for (OClass c : classes.values()) { if (OArrays.contains(c.getPolymorphicClusterIds(), clusterId)) result.add(c); } return result; }
final ConsoleParameter annotation = (ConsoleParameter) paramAnn[annNum]; if (annotation.optional()) commandWords = OArrays.copyOf(commandWords, commandWords.length + 1); break; methodArgs = OArrays.copyOfRange(commandWords, commandWordCount, commandWords.length);
public Set<OClass> getClassesRelyOnCluster(ODatabaseDocumentInternal database, final String clusterName) { database.checkSecurity(ORule.ResourceGeneric.SCHEMA, ORole.PERMISSION_READ); acquireSchemaReadLock(); try { final int clusterId = database.getClusterIdByName(clusterName); final Set<OClass> result = new HashSet<OClass>(); for (OClass c : classes.values()) { if (OArrays.contains(c.getPolymorphicClusterIds(), clusterId)) result.add(c); } return result; } finally { releaseSchemaReadLock(); } }
public byte[] getAsByteArrayFixed(final int iSize) { if (position >= buffer.length) return null; final byte[] portion = OArrays.copyOfRange(buffer, position, position + iSize); position += iSize; return portion; }
public static <T> T[] copyOf(final T[] iSource, final int iNewSize) { return (T[]) copyOf(iSource, iNewSize, iSource.getClass()); }
public static <S> S[] copyOfRange(final S[] iSource, final int iBegin, final int iEnd) { return copyOfRange(iSource, iBegin, iEnd, (Class<S[]>) iSource.getClass()); }
protected void addPolymorphicClusterId(int clusterId) { if (Arrays.binarySearch(polymorphicClusterIds, clusterId) >= 0) return; polymorphicClusterIds = OArrays.copyOf(polymorphicClusterIds, polymorphicClusterIds.length + 1); polymorphicClusterIds[polymorphicClusterIds.length - 1] = clusterId; Arrays.sort(polymorphicClusterIds); addClusterIdToIndexes(clusterId); for (OClassImpl superClass : superClasses) { superClass.addPolymorphicClusterId(clusterId); } }
public static <S> S[] copyOfRange(final S[] iSource, final int iBegin, final int iEnd) { return copyOfRange(iSource, iBegin, iEnd, (Class<S[]>) iSource.getClass()); }
protected OClass addClusterIdInternal(ODatabaseDocumentInternal database, final int clusterId) { acquireSchemaWriteLock(); try { checkEmbedded(); owner.checkClusterCanBeAdded(clusterId, this); for (int currId : clusterIds) if (currId == clusterId) // ALREADY ADDED return this; clusterIds = OArrays.copyOf(clusterIds, clusterIds.length + 1); clusterIds[clusterIds.length - 1] = clusterId; Arrays.sort(clusterIds); addPolymorphicClusterId(clusterId); if (defaultClusterId == NOT_EXISTENT_CLUSTER_ID) defaultClusterId = clusterId; ((OSchemaEmbedded) owner).addClusterForClass(database, clusterId, this); return this; } finally { releaseSchemaWriteLock(); } }
public byte[] getAsByteArray() { if (position >= buffer.length) return null; final int size = OBinaryProtocol.bytes2int(buffer, position); position += OBinaryProtocol.SIZE_INT; final byte[] portion = OArrays.copyOfRange(buffer, position, position + size); position += size; return portion; }
public byte[] getAsByteArray(int iOffset) throws IOException { if (buffer == null || iOffset >= length) return null; final int size = OBinaryProtocol.bytes2int(buffer, iOffset); if (size == 0) return null; iOffset += OBinaryProtocol.SIZE_INT; return OArrays.copyOfRange(buffer, iOffset, iOffset + size); }
public byte[] getAsByteArray(int iOffset) { if (buffer == null || iOffset >= buffer.length) return null; final int size = OBinaryProtocol.bytes2int(buffer, iOffset); if (size == 0) return null; iOffset += OBinaryProtocol.SIZE_INT; return OArrays.copyOfRange(buffer, iOffset, iOffset + size); }
public byte[] getAsByteArray() throws IOException { if (position >= length) return null; final int size = OBinaryProtocol.bytes2int(buffer, position); position += OBinaryProtocol.SIZE_INT; final byte[] portion = OArrays.copyOfRange(buffer, position, position + size); position += size; return portion; }
return stream.fromStream(OArrays.copyOfRange(iStream, 4 + classNameSize, iStream.length), serializer);