代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
Java
】
小端数据输入流
作者:
Dezai.CN
/ 发布于
2011/12/1
/
659
<div> public class LEDataInputStream implements DataInput { protected final DataInputStream din; protected final InputStream is; protected final byte[] work; public static String readUTF(DataInput in) throws IOException { return DataInputStream.readUTF(in); } public LEDataInputStream(InputStream in) { is = in; din = new DataInputStream(in); work = new byte[8]; } public final void close() throws IOException { din.close(); } public final int read(byte ba[], int off, int len) throws IOException { return is.read(ba, off, len); } public final boolean readBoolean() throws IOException { return din.readBoolean(); } public final byte readByte() throws IOException { return din.readByte(); } public final char readChar() throws IOException { din.readFully(work, 0, 2); return (char) ((work[1] & 0xff) << 8 | (work[0] & 0xff)); } public final double readDouble() throws IOException { return Double.longBitsToDouble(readLong()); } public final float readFloat() throws IOException { return Float.intBitsToFloat(readInt()); } public final void readFully(byte ba[]) throws IOException { din.readFully(ba, 0, ba.length); } public final void readFully(byte ba[], int off, int len) throws IOException { din.readFully(ba, off, len); } public final int readInt() throws IOException { din.readFully(work, 0, 4); return (work[3]) << 24 | (work[2] & 0xff) << 16 | (work[1] & 0xff) << 8 | (work[0] & 0xff); } public final String readLine() throws IOException { return din.readLine(); } public final long readLong() throws IOException { din.readFully(work, 0, 8); return (long) (work[7]) << 56 | (long) (work[6] & 0xff) << 48 | (long) (work[5] & 0xff) << 40 | (long) (work[4] & 0xff) << 32 | (long) (work[3] & 0xff) << 24 | (long) (work[2] & 0xff) << 16 | (long) (work[1] & 0xff) << 8 | (long) (work[0] & 0xff); } public final short readShort() throws IOException { din.readFully(work, 0, 2); return (short) ((work[1] & 0xff) << 8 | (work[0] & 0xff)); } public final String readUTF() throws IOException { return din.readUTF(); } public final int readUnsignedByte() throws IOException { return din.readUnsignedByte(); } public final int readUnsignedShort() throws IOException { din.readFully(work, 0, 2); return ((work[1] & 0xff) << 8 | (work[0] & 0xff)); } public final int skipBytes(int n) throws IOException { return din.skipBytes(n); } }
试试其它关键字
小端数据输入流
同语言下
.
List 切割成几份 工具类
.
一行一行读取txt的内容
.
Java PDF转换成图片并输出给前台展示
.
java 多线程框架
.
double类型如果小数点后为零则显示整数否则保留两位小
.
将图片转换为Base64字符串公共类抽取
.
sqlParser 处理SQL(增删改查) 替换schema 用于多租户
.
JAVA 月份中的第几周处理 1-7属于第一周 依次类推 29-
.
java计算两个经纬度之间的距离
.
输入时间参数计算年龄
可能有用的
.
C#实现的html内容截取
.
List 切割成几份 工具类
.
SQL查询 多列合并成一行用逗号隔开
.
一行一行读取txt的内容
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
Java PDF转换成图片并输出给前台展示
.
网站后台修改图片尺寸代码
.
处理大图片在缩略图时的展示
Dezai.CN
贡献的其它代码
(
4037
)
.
多线程Socket服务器模块
.
生成随机密码
.
清除浮动样式
.
弹出窗口居中
.
抓取url的函数
.
使用base HTTP验证
.
div模拟iframe嵌入效果
.
通过header转向的方法
.
Session操作类
.
执行sqlite输入插入操作后获得自动编号的ID
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3