private static String readString ( byte[] buffer, int bufferIndex, int len ) { // this is not absolutely correct, but we assume that the header is aligned if ( ( bufferIndex % 2 ) != 0 ) { bufferIndex++; } return Strings.fromUNIBytes(buffer, bufferIndex, Strings.findUNITermination(buffer, bufferIndex, len)); }
private static String readString ( byte[] buffer, int bufferIndex, int len ) { // this is not absolutely correct, but we assume that the header is aligned if ( ( bufferIndex % 2 ) != 0 ) { bufferIndex++; } return Strings.fromUNIBytes(buffer, bufferIndex, Strings.findUNITermination(buffer, bufferIndex, len)); }
int len = 0; if ( ( this.negotiatedFlags2 & SmbConstants.FLAGS2_UNICODE ) == SmbConstants.FLAGS2_UNICODE ) { len = Strings.findUNITermination(buffer, bufferIndex, 256); this.server.oemDomainName = Strings.fromUNIBytes(buffer, bufferIndex, len);
int len = 0; if ( ( this.negotiatedFlags2 & SmbConstants.FLAGS2_UNICODE ) == SmbConstants.FLAGS2_UNICODE ) { len = Strings.findUNITermination(buffer, bufferIndex, 256); this.server.oemDomainName = Strings.fromUNIBytes(buffer, bufferIndex, len);
/** * * @param src * @param srcIndex * @param maxLen * @param unicode * @return read string */ public String readString ( byte[] src, int srcIndex, int maxLen, boolean unicode ) { if ( unicode ) { // Unicode requires word alignment if ( ( ( srcIndex - this.headerStart ) % 2 ) != 0 ) { srcIndex++; } return Strings.fromUNIBytes(src, srcIndex, Strings.findUNITermination(src, srcIndex, maxLen)); } return Strings.fromOEMBytes(src, srcIndex, Strings.findTermination(src, srcIndex, maxLen), getConfig()); }
/** * * @param src * @param srcIndex * @param srcEnd * @param maxLen * @param unicode * @return read string */ public String readString ( byte[] src, int srcIndex, int srcEnd, int maxLen, boolean unicode ) { if ( unicode ) { // Unicode requires word alignment if ( ( ( srcIndex - this.headerStart ) % 2 ) != 0 ) { srcIndex++; } return Strings.fromUNIBytes(src, srcIndex, Strings.findUNITermination(src, srcIndex, maxLen)); } return Strings.fromOEMBytes(src, srcIndex, Strings.findTermination(src, srcIndex, maxLen), getConfig()); }
/** * * @param src * @param srcIndex * @param maxLen * @param unicode * @return read string */ public String readString ( byte[] src, int srcIndex, int maxLen, boolean unicode ) { if ( unicode ) { // Unicode requires word alignment if ( ( ( srcIndex - this.headerStart ) % 2 ) != 0 ) { srcIndex++; } return Strings.fromUNIBytes(src, srcIndex, Strings.findUNITermination(src, srcIndex, maxLen)); } return Strings.fromOEMBytes(src, srcIndex, Strings.findTermination(src, srcIndex, maxLen), getConfig()); }
/** * * @param src * @param srcIndex * @param srcEnd * @param maxLen * @param unicode * @return read string */ public String readString ( byte[] src, int srcIndex, int srcEnd, int maxLen, boolean unicode ) { if ( unicode ) { // Unicode requires word alignment if ( ( ( srcIndex - this.headerStart ) % 2 ) != 0 ) { srcIndex++; } return Strings.fromUNIBytes(src, srcIndex, Strings.findUNITermination(src, srcIndex, maxLen)); } return Strings.fromOEMBytes(src, srcIndex, Strings.findTermination(src, srcIndex, maxLen), getConfig()); }