Skip to content
This repository has been archived by the owner on Oct 13, 2022. It is now read-only.

Commit

Permalink
更新1.10.4
Browse files Browse the repository at this point in the history
增加实现一个EmptyInputStream类
  • Loading branch information
ForteScarlet committed Mar 20, 2020
1 parent 6bff02e commit 406dcd6
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<artifactId>simple-robot-core</artifactId>

<!-- 版本号 -->
<!-- 下次部署需要大于1.10.3 2020/3/17 记得修改CoreSystem的版本号 -->
<version>1.10.3</version>
<!-- 下次部署需要大于1.10.4 2020/3/20 记得修改CoreSystem的版本号 -->
<version>1.10.4</version>

<packaging>jar</packaging>
<name>simple-robot</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import com.forte.qqrobot.exception.ConfigurationException;
import com.forte.qqrobot.sender.MsgSender;
import com.forte.qqrobot.utils.CQCodeUtil;
import com.forte.qqrobot.utils.EmptyInputStream;
import com.forte.qqrobot.utils.FieldUtils;
import org.apache.http.impl.io.EmptyInputStream;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/forte/qqrobot/system/CoreSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @author ForteScarlet
* @version 1.7.0
*/
@Version(version = "1.10.3")
@Version(version = "1.10.4")
public final class CoreSystem {

/** 当前程序的RUN_TIME对象 */
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/forte/qqrobot/test/TestGroupMsg.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* @author ForteScarlet <[email][email protected]>
* @since JDK1.8
**/
@Deprecated
public class TestGroupMsg implements GroupMsg {

private String QQ = "00000000";
Expand Down
86 changes: 86 additions & 0 deletions src/main/java/com/forte/qqrobot/utils/EmptyInputStream.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/

package com.forte.qqrobot.utils;

import java.io.InputStream;

/**
* 一个空的输入流
* copy自4.4版本的httpcore
* @since 4.4
*/
public final class EmptyInputStream extends InputStream {

public static final EmptyInputStream INSTANCE = new EmptyInputStream();

private EmptyInputStream() {
}

@Override
public int available() {
return 0;
}

@Override
public void close() {
}

@Override
public void mark(final int readLimit) {
}

@Override
public boolean markSupported() {
return true;
}

@Override
public int read() {
return -1;
}

@Override
public int read(final byte[] buf) {
return -1;
}

@Override
public int read(final byte[] buf, final int off, final int len) {
return -1;
}

@Override
public void reset() {
}

@Override
public long skip(final long n) {
return 0L;
}
}

3 changes: 3 additions & 0 deletions update.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## 版本更新记录

# 1.10.4
- 替换代码中所使用的`EmptyInputStream`为代码内部实现的类而非`httpcore`内的类,以防止一些可能发生的版本冲突。

## 1.10.3
- 修复CQCodeUtil中取出CQ码的bug,并且不再使用正则取值。

Expand Down

0 comments on commit 406dcd6

Please sign in to comment.